~ubuntu-branches/ubuntu/natty/freecell-solver/natty

« back to all changes in this revision

Viewing changes to upstream-debian/rules

  • Committer: Bazaar Package Importer
  • Author(s): RISKO Gergely
  • Date: 2009-03-15 23:42:21 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20090315234221-sx95hxyfyfgi0pja
Tags: 2.16.0-1
* Imported Upstream version 2.16.0 (closes: #518440)
* cmake is the new buildsystem

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/make -f 
 
2
 
 
3
PACKAGEshd=libfreecell-solver0
 
4
PACKAGEdev=libfreecell-solver-dev
 
5
PACKAGEbin=freecell-solver-bin
 
6
 
 
7
 
 
8
arch    = $(shell dpkg --print-architecture)
 
9
tmp     = debian/tmp
 
10
tmp-dev = debian/tmp-dev
 
11
tmp-bin = debian/tmp-bin
 
12
 
 
13
docdir          = usr/share/doc
 
14
mandir          = usr/share/man
 
15
bindir          = usr/bin
 
16
 
 
17
build: config.status
 
18
        test -e debian/control
 
19
        $(MAKE)
 
20
 
 
21
 
 
22
config.status:
 
23
        ./configure \
 
24
        --prefix=/usr \
 
25
        --enable-states-type=indirect \
 
26
        --enable-max-num-freecells=8 \
 
27
        --enable-max-num-initial-cards-per-stack=104 \
 
28
        --enable-max--num-stacks=12 \
 
29
        --enable-max-num-decks=2 
 
30
 
 
31
 
 
32
binary-indep: build
 
33
 
 
34
#Build our packages.
 
35
binary-arch: build testroot debian/control
 
36
        #
 
37
        # Build libfreecell-solver0 package
 
38
        #
 
39
        
 
40
        make prefix=`pwd`/$(tmp)/usr install
 
41
        install -d --mode=755 $(tmp)/$(docdir)/$(PACKAGEshd)
 
42
        install -d --mode=755 $(tmp)/DEBIAN
 
43
        
 
44
        #
 
45
        # Remove cruft 
 
46
        #
 
47
        
 
48
        rm -rf $(tmp)/usr/bin
 
49
        rm -rf $(tmp)/usr/include
 
50
        rm -f $(tmp)/usr/lib/*a
 
51
        rm -f $(tmp)/usr/lib/libfreecell-solver.so
 
52
        rm -rf $(tmp)/usr/man
 
53
        
 
54
        #
 
55
        # Install documentation
 
56
        #
 
57
        
 
58
        install --mode=644 "debian/copyright" $(tmp)/$(docdir)/$(PACKAGEshd)
 
59
        install --mode=644 "debian/changelog" \
 
60
            $(tmp)/$(docdir)/$(PACKAGEshd)/changelog.Debian
 
61
        install --mode=644 "ChangeLog" \
 
62
                $(tmp)/$(docdir)/$(PACKAGEshd)/changelog
 
63
        install --mode=644 "NEWS"             $(tmp)/$(docdir)/$(PACKAGEshd)
 
64
        install --mode=644 "README"           $(tmp)/$(docdir)/$(PACKAGEshd)
 
65
        install --mode=644 "TODO"             $(tmp)/$(docdir)/$(PACKAGEshd)
 
66
        install --mode=644 "CREDITS"          $(tmp)/$(docdir)/$(PACKAGEshd)
 
67
        
 
68
        #
 
69
        # Compress changelogs
 
70
        #
 
71
        
 
72
        gzip -9f $(tmp)/$(docdir)/$(PACKAGEshd)/changelog*
 
73
        
 
74
        #
 
75
        # Strip the so and change its permssions.
 
76
        #
 
77
        
 
78
        strip --strip-all -R .comment -R .note \
 
79
            $(tmp)/usr/lib/libfreecell-solver.so.*
 
80
        chmod 644 $(tmp)/usr/lib/libfreecell-solver.so.*
 
81
        
 
82
        #
 
83
        # Install package scripts
 
84
        #
 
85
        
 
86
        install --mode=644 debian/libfreecell-solver0.shlibs $(tmp)/DEBIAN/shlibs
 
87
        install --mode=755 debian/postinst.shd $(tmp)/DEBIAN/postinst
 
88
        cat debian/prerm.generic | sed 's/__PKG__/$(PACKAGEshd)/g' > \
 
89
             $(tmp)/DEBIAN/prerm 
 
90
        chmod 755 $(tmp)/DEBIAN/prerm $(tmp)/DEBIAN/postinst
 
91
        dpkg-shlibdeps $(tmp)/usr/lib/libfreecell-solver.so.*
 
92
        dpkg-gencontrol -ips -P$(tmp) -p$(PACKAGEshd)
 
93
        dpkg --build $(tmp) ..
 
94
        
 
95
        #----------------------------------------------------------------------#
 
96
        #
 
97
        # Build libfreecell-solver-dev package
 
98
        #
 
99
        
 
100
        make prefix=`pwd`/$(tmp-dev)/usr install
 
101
        install -d --mode=755 $(tmp-dev)/$(docdir)/$(PACKAGEdev)
 
102
        install -d --mode=755 $(tmp-dev)/DEBIAN
 
103
        
 
104
        #
 
105
        # Remove cruft
 
106
        #
 
107
        
 
108
        rm -rf $(tmp-dev)/usr/lib/*so*0*
 
109
        rm -rf $(tmp-dev)/usr/lib/*.la*
 
110
        rm -rf $(tmp-dev)/usr/bin
 
111
        rm -rf $(tmp-dev)/usr/man
 
112
        
 
113
        install -d --mode=755 $(tmp-dev)/usr/bin
 
114
        install --mode=755 "freecell-solver-config" $(tmp-dev)/usr/bin
 
115
        
 
116
        #
 
117
        # Install documentation
 
118
        #
 
119
        
 
120
        install --mode=644 "debian/copyright" $(tmp-dev)/$(docdir)/$(PACKAGEdev)
 
121
        install --mode=644 "debian/changelog" \
 
122
            $(tmp-dev)/$(docdir)/$(PACKAGEdev)/changelog.Debian
 
123
        install --mode=644 "ChangeLog" \
 
124
                $(tmp-dev)/$(docdir)/$(PACKAGEdev)/changelog
 
125
        install --mode=644 "NEWS"             $(tmp-dev)/$(docdir)/$(PACKAGEdev)
 
126
        install --mode=644 "README"           $(tmp-dev)/$(docdir)/$(PACKAGEdev)
 
127
        install --mode=644 "TODO"             $(tmp-dev)/$(docdir)/$(PACKAGEdev)
 
128
        install --mode=644 "CREDITS"          $(tmp-dev)/$(docdir)/$(PACKAGEdev)
 
129
        install --mode=644 `find devel_docs -type f -maxdepth 1`        $(tmp-dev)/$(docdir)/$(PACKAGEdev)
 
130
        
 
131
        install -d --mode=755 $(tmp-dev)/usr/share/lintian/overrides
 
132
        install --mode=644 "debian/libfreecell-solver-dev.lintian" $(tmp-dev)/usr/share/lintian/overrides/libfreecell-solver-dev
 
133
        
 
134
        #
 
135
        # Strip the .a
 
136
        #
 
137
        
 
138
        strip --strip-debug $(tmp-dev)/usr/lib/libfreecell-solver.a
 
139
        
 
140
        #
 
141
        # Compress changelogs
 
142
        #
 
143
        
 
144
        gzip -9f $(tmp-dev)/$(docdir)/$(PACKAGEdev)/changelog*
 
145
        
 
146
        #
 
147
        # Install special files
 
148
        #
 
149
        
 
150
        cat debian/postinst.generic | sed 's/__PKG__/$(PACKAGEdev)/g' > \
 
151
             $(tmp-dev)/DEBIAN/postinst
 
152
        cat debian/prerm.generic | sed 's/__PKG__/$(PACKAGEdev)/g' > \
 
153
             $(tmp-dev)/DEBIAN/prerm 
 
154
        chmod 755 $(tmp-dev)/DEBIAN/prerm $(tmp-dev)/DEBIAN/postinst
 
155
        dpkg-gencontrol -ips -P$(tmp-dev) -p$(PACKAGEdev)
 
156
        dpkg --build $(tmp-dev) ..
 
157
        
 
158
        
 
159
        #----------------------------------------------------------------------#
 
160
        #
 
161
        # Build freecell-solver-bin package
 
162
        #
 
163
        
 
164
        make prefix=`pwd`/$(tmp-bin)/usr install
 
165
        mv $(tmp-bin)/usr/bin/pi-make-microsoft-freecell-board $(tmp-bin)/usr/bin/make-microsoft-freecell-board
 
166
        rm $(tmp-bin)/usr/bin/freecell-solver-range-parallel-solve
 
167
        rm $(tmp-bin)/usr/bin/freecell-solver-config
 
168
 
 
169
        install -d --mode=755 $(tmp-bin)/$(docdir)/$(PACKAGEbin)
 
170
        install -d --mode=755 $(tmp-bin)/DEBIAN
 
171
        install -d --mode=755 $(tmp-bin)/$(mandir)/man6
 
172
        
 
173
        #
 
174
        # Remove cruft
 
175
        #
 
176
        
 
177
        rm -rf $(tmp-bin)/usr/man
 
178
        rm -rf $(tmp-bin)/usr/lib/
 
179
        rm -rf $(tmp-bin)/usr/include/
 
180
        
 
181
        #
 
182
        # Strip stuff
 
183
        #
 
184
        
 
185
        strip --strip-all -R .comment -R .note $(tmp-bin)/usr/bin/*board
 
186
        strip --strip-all -R .comment -R .note $(tmp-bin)/usr/bin/fc-solve
 
187
        
 
188
        #
 
189
        # Install documentation
 
190
        #
 
191
        
 
192
        install --mode=644 "debian/copyright" \
 
193
            $(tmp-bin)/$(docdir)/$(PACKAGEbin)/copyright
 
194
        install --mode=644 "debian/changelog" \
 
195
            $(tmp-bin)/$(docdir)/$(PACKAGEbin)/changelog.Debian
 
196
        install --mode=644 "ChangeLog" \
 
197
                $(tmp-bin)/$(docdir)/$(PACKAGEbin)/changelog
 
198
        install --mode=644 "NEWS"             $(tmp-bin)/$(docdir)/$(PACKAGEbin)
 
199
        install --mode=644 "USAGE"            $(tmp-bin)/$(docdir)/$(PACKAGEbin)
 
200
        install --mode=644 "README"           $(tmp-bin)/$(docdir)/$(PACKAGEbin)
 
201
        install --mode=644 "TODO"             $(tmp-bin)/$(docdir)/$(PACKAGEbin)
 
202
        install --mode=644 "CREDITS"          $(tmp-bin)/$(docdir)/$(PACKAGEbin)
 
203
        install --mode=644 "fc-solve.6"       $(tmp-bin)/$(mandir)/man6
 
204
        install --mode=644 board_gen/*.6 \
 
205
                $(tmp-bin)/$(mandir)/man6
 
206
        mv $(tmp-bin)/$(mandir)/man6/pi-make-microsoft-freecell-board.6 $(tmp-bin)/$(mandir)/man6/make-microsoft-freecell-board.6
 
207
        #install --mode=644 debian/*.6 \
 
208
                #$(tmp-bin)/$(mandir)/man6
 
209
        
 
210
        #
 
211
        # Compress changelogs and man pages
 
212
        #
 
213
        
 
214
        gzip -9f $(tmp-bin)/$(docdir)/$(PACKAGEbin)/changelog*
 
215
        gzip -9f $(tmp-bin)/$(mandir)/man6/*
 
216
        
 
217
        #
 
218
        # Install special files
 
219
        #
 
220
        
 
221
        cat debian/postinst.generic | sed 's/__PKG__/$(PACKAGEbin)/g' > \
 
222
             $(tmp-bin)/DEBIAN/postinst
 
223
        cat debian/prerm.generic | sed 's/__PKG__/$(PACKAGEbin)/g' > \
 
224
             $(tmp-bin)/DEBIAN/prerm 
 
225
        chmod 755 $(tmp-bin)/DEBIAN/prerm $(tmp-bin)/DEBIAN/postinst
 
226
        dpkg-shlibdeps $(tmp-bin)/usr/bin/*board $(tmp-bin)/usr/bin/fc-solve
 
227
        dpkg-gencontrol -ips -P$(tmp-bin) -p$(PACKAGEbin)
 
228
        dpkg --build $(tmp-bin) ..
 
229
        
 
230
 
 
231
clean: testroot
 
232
        test -e debian/control
 
233
        rm -f debian/substvars debian/files *orig* *bak* debian/*bak
 
234
        rm -rf debian/tmp
 
235
        rm -rf debian/tmp-dev
 
236
        rm -rf debian/tmp-bin
 
237
        -$(MAKE) distclean
 
238
        rm -f config.h
 
239
 
 
240
binary: binary-indep binary-arch
 
241
 
 
242
testroot:
 
243
        test root = "`whoami`" || (echo Need root privelages; exit 1);
 
244
 
 
245
.PHONY: build binary-indep binary-arch binary clean