author | matthijs |
Wed, 03 Sep 2008 17:18:04 +0000 | |
changeset 10070 | 8970f1074f21 |
parent 10069 | 891d75deeb73 |
child 10098 | de9c1bd521c8 |
permissions | -rwxr-xr-x |
285 | 1 |
#!/usr/bin/make -f |
2 |
# -*- makefile -*- |
|
3 |
# Sample debian/rules that uses debhelper. |
|
4 |
# GNU copyright 1997 to 1999 by Joey Hess. |
|
5 |
||
6 |
# Uncomment this to turn on verbose mode. |
|
7 |
#export DH_VERBOSE=1 |
|
8 |
||
10069
891d75deeb73
(svn r14237) -Feature [Debian]: Allow the Debian packaging to change the package name of the resulting package.
matthijs
parents:
7267
diff
changeset
|
9 |
DEFAULT_PACKAGE := openttd |
891d75deeb73
(svn r14237) -Feature [Debian]: Allow the Debian packaging to change the package name of the resulting package.
matthijs
parents:
7267
diff
changeset
|
10 |
# Find the package name from the topmost changelog entry. |
891d75deeb73
(svn r14237) -Feature [Debian]: Allow the Debian packaging to change the package name of the resulting package.
matthijs
parents:
7267
diff
changeset
|
11 |
# Is this the best way to do this? |
891d75deeb73
(svn r14237) -Feature [Debian]: Allow the Debian packaging to change the package name of the resulting package.
matthijs
parents:
7267
diff
changeset
|
12 |
PACKAGE = $(shell cat debian/changelog | head -1 | cut -f1 -d' ') |
891d75deeb73
(svn r14237) -Feature [Debian]: Allow the Debian packaging to change the package name of the resulting package.
matthijs
parents:
7267
diff
changeset
|
13 |
|
891d75deeb73
(svn r14237) -Feature [Debian]: Allow the Debian packaging to change the package name of the resulting package.
matthijs
parents:
7267
diff
changeset
|
14 |
debian/control: |
891d75deeb73
(svn r14237) -Feature [Debian]: Allow the Debian packaging to change the package name of the resulting package.
matthijs
parents:
7267
diff
changeset
|
15 |
# Generate control file |
891d75deeb73
(svn r14237) -Feature [Debian]: Allow the Debian packaging to change the package name of the resulting package.
matthijs
parents:
7267
diff
changeset
|
16 |
sed 's/PACKAGE/$(PACKAGE)/' debian/control.in > debian/control |
891d75deeb73
(svn r14237) -Feature [Debian]: Allow the Debian packaging to change the package name of the resulting package.
matthijs
parents:
7267
diff
changeset
|
17 |
|
891d75deeb73
(svn r14237) -Feature [Debian]: Allow the Debian packaging to change the package name of the resulting package.
matthijs
parents:
7267
diff
changeset
|
18 |
# TODO: How to do this using makefile conditionals? |
891d75deeb73
(svn r14237) -Feature [Debian]: Allow the Debian packaging to change the package name of the resulting package.
matthijs
parents:
7267
diff
changeset
|
19 |
if [ "$(PACKAGE)" != "$(DEFAULT_PACKAGE)" ]; then \ |
891d75deeb73
(svn r14237) -Feature [Debian]: Allow the Debian packaging to change the package name of the resulting package.
matthijs
parents:
7267
diff
changeset
|
20 |
echo "Provides: $(DEFAULT_PACKAGE)" >> debian/control ; \ |
891d75deeb73
(svn r14237) -Feature [Debian]: Allow the Debian packaging to change the package name of the resulting package.
matthijs
parents:
7267
diff
changeset
|
21 |
echo "Conflicts: $(DEFAULT_PACKAGE)" >> debian/control ; \ |
891d75deeb73
(svn r14237) -Feature [Debian]: Allow the Debian packaging to change the package name of the resulting package.
matthijs
parents:
7267
diff
changeset
|
22 |
fi; |
891d75deeb73
(svn r14237) -Feature [Debian]: Allow the Debian packaging to change the package name of the resulting package.
matthijs
parents:
7267
diff
changeset
|
23 |
|
10070
8970f1074f21
(svn r14238) -Change [Debian]: Update Debian packaging files to the latest official Debian version.
matthijs
parents:
10069
diff
changeset
|
24 |
configure: debian/control configure-stamp |
285 | 25 |
configure-stamp: |
26 |
dh_testdir |
|
27 |
# Add here commands to configure the package. |
|
28 |
||
29 |
touch configure-stamp |
|
30 |
||
31 |
||
10069
891d75deeb73
(svn r14237) -Feature [Debian]: Allow the Debian packaging to change the package name of the resulting package.
matthijs
parents:
7267
diff
changeset
|
32 |
build: debian/control configure build-stamp |
5356
0d5d19f88ad1
(svn r7533) -Codechange [Debian]: Update debian packaging files
matthijs
parents:
3170
diff
changeset
|
33 |
build-stamp: |
285 | 34 |
dh_testdir |
35 |
||
36 |
# Add here commands to compile the package. |
|
37 |
||
10069
891d75deeb73
(svn r14237) -Feature [Debian]: Allow the Debian packaging to change the package name of the resulting package.
matthijs
parents:
7267
diff
changeset
|
38 |
./configure --prefix-dir=/usr --binary-dir=games --data-dir=share/games/openttd --icon-dir=share/pixmaps --personal-dir=.openttd --install-dir=debian/$(PACKAGE) |
5484
7ad86e421c42
(svn r7768) -Fix (r7765): use $(MAKE) instead of make in the debian rules.
rubidium
parents:
5481
diff
changeset
|
39 |
$(MAKE) |
285 | 40 |
|
41 |
#/usr/bin/docbook-to-man debian/openttd.sgml > openttd.1 |
|
42 |
||
43 |
touch build-stamp |
|
44 |
||
10070
8970f1074f21
(svn r14238) -Change [Debian]: Update Debian packaging files to the latest official Debian version.
matthijs
parents:
10069
diff
changeset
|
45 |
clean: debian/control |
285 | 46 |
dh_testdir |
47 |
dh_testroot |
|
48 |
rm -f build-stamp configure-stamp |
|
49 |
||
50 |
# Add here commands to clean up after the build process. |
|
10070
8970f1074f21
(svn r14238) -Change [Debian]: Update Debian packaging files to the latest official Debian version.
matthijs
parents:
10069
diff
changeset
|
51 |
# We check for Makefile presence, because clean is called at the |
8970f1074f21
(svn r14238) -Change [Debian]: Update Debian packaging files to the latest official Debian version.
matthijs
parents:
10069
diff
changeset
|
52 |
# start of the build process (before configure) where we don't |
8970f1074f21
(svn r14238) -Change [Debian]: Update Debian packaging files to the latest official Debian version.
matthijs
parents:
10069
diff
changeset
|
53 |
# have a Makefile yet. |
8970f1074f21
(svn r14238) -Change [Debian]: Update Debian packaging files to the latest official Debian version.
matthijs
parents:
10069
diff
changeset
|
54 |
[ ! -f Makefile ] || $(MAKE) distclean |
285 | 55 |
|
5356
0d5d19f88ad1
(svn r7533) -Codechange [Debian]: Update debian packaging files
matthijs
parents:
3170
diff
changeset
|
56 |
dh_clean |
10069
891d75deeb73
(svn r14237) -Feature [Debian]: Allow the Debian packaging to change the package name of the resulting package.
matthijs
parents:
7267
diff
changeset
|
57 |
# Clean up generated control file |
891d75deeb73
(svn r14237) -Feature [Debian]: Allow the Debian packaging to change the package name of the resulting package.
matthijs
parents:
7267
diff
changeset
|
58 |
-rm debian/control |
285 | 59 |
|
10069
891d75deeb73
(svn r14237) -Feature [Debian]: Allow the Debian packaging to change the package name of the resulting package.
matthijs
parents:
7267
diff
changeset
|
60 |
install: debian/control build |
285 | 61 |
dh_testdir |
62 |
dh_testroot |
|
5356
0d5d19f88ad1
(svn r7533) -Codechange [Debian]: Update debian packaging files
matthijs
parents:
3170
diff
changeset
|
63 |
dh_clean -k |
285 | 64 |
dh_installdirs |
65 |
||
66 |
# Add here commands to install the package into debian/openttd. |
|
5481
c194404a46b0
(svn r7765) -Fix (r7759): forgot to update the os/debian files.
rubidium
parents:
5356
diff
changeset
|
67 |
$(MAKE) install |
285 | 68 |
|
69 |
# Build architecture-independent files here. |
|
70 |
binary-indep: build install |
|
71 |
# We have nothing to do by default. |
|
72 |
||
73 |
# Build architecture-dependent files here. |
|
10069
891d75deeb73
(svn r14237) -Feature [Debian]: Allow the Debian packaging to change the package name of the resulting package.
matthijs
parents:
7267
diff
changeset
|
74 |
binary-arch: debian/control build install |
285 | 75 |
dh_testdir |
76 |
dh_testroot |
|
77 |
dh_installchangelogs changelog.txt |
|
78 |
dh_installdocs |
|
79 |
dh_installexamples |
|
80 |
# dh_install |
|
1143
5879a8637190
(svn r1644) - Some minor corrections to the os/debian dir.
matthijs
parents:
680
diff
changeset
|
81 |
dh_installmenu |
3170
3740e285e4df
(svn r3801) * Update debian packaging files to the ones used for releasing 0.4.5 (see os/debian/changelog for details).
matthijs
parents:
1865
diff
changeset
|
82 |
dh_installdebconf |
285 | 83 |
# dh_installlogrotate |
84 |
# dh_installemacsen |
|
85 |
# dh_installpam |
|
86 |
# dh_installmime |
|
87 |
# dh_installinit |
|
88 |
# dh_installcron |
|
89 |
# dh_installinfo |
|
90 |
dh_installman docs/openttd.6 |
|
91 |
dh_link |
|
92 |
dh_strip |
|
93 |
dh_compress |
|
94 |
dh_fixperms |
|
95 |
# dh_perl |
|
96 |
# dh_python |
|
97 |
# dh_makeshlibs |
|
98 |
dh_installdeb |
|
99 |
dh_shlibdeps |
|
100 |
dh_gencontrol |
|
101 |
dh_md5sums |
|
102 |
dh_builddeb |
|
103 |
||
104 |
binary: binary-indep binary-arch |
|
10070
8970f1074f21
(svn r14238) -Change [Debian]: Update Debian packaging files to the latest official Debian version.
matthijs
parents:
10069
diff
changeset
|
105 |
.PHONY: build clean binary-indep binary-arch binary install configure |