~ubuntu-branches/ubuntu/hardy/steam/hardy

« back to all changes in this revision

Viewing changes to debian/rules

  • Committer: Bazaar Package Importer
  • Author(s): Alain Schroeder
  • Date: 2006-11-21 16:03:12 UTC
  • mfrom: (2.1.4 feisty)
  • Revision ID: james.westby@ubuntu.com-20061121160312-nf96y6nihzsyd2uv
Tags: 2.2.31-3
Add patch to prevent inconsistent data after shutdown.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/make -f
2
2
# Uncomment this to turn on verbose mode.
3
 
export DH_VERBOSE=1
 
3
#export DH_VERBOSE=1
4
4
export INSTALL_DIR=debian/steam
5
5
export INSTALL_LIBDIR=debian/steam-lib
6
6
export PREFIX=/usr
8
8
export REAL_LIBDIR=/lib/steam
9
9
 
10
10
# This is the debhelper compatibility version to use.
11
 
export DH_COMPAT=3
 
11
export DH_COMPAT=4
12
12
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
13
13
       CFLAGS += -g
14
14
endif
16
16
        INSTALL_PROGRAM += -s
17
17
endif
18
18
 
19
 
PIKE=pike7.4
 
19
PIKE=pike7.6
20
20
PIKEBIN=/usr/bin/$(PIKE)
21
21
 
22
 
PIKE_VERSION=$(shell $(PIKEBIN) -e 'string v; int rel;sscanf(version(), "Pike v%s release %d", v, rel); write(v+"."+rel);')
 
22
PIKE_VERSION=$(shell $(PIKEBIN) -e \
 
23
'string v; int rel;sscanf(version(), "Pike v%s release %d", v, rel); write(v+"."+rel);')
23
24
export PIKE_INCLUDE_PREFIX=/usr/include/pike/$(PIKE_VERSION)
24
25
 
 
26
patch: patch-stamp
 
27
patch-stamp:
 
28
        dpatch apply-all
 
29
        touch patch-stamp
 
30
 
 
31
unpatch:
 
32
        dpatch deapply-all
 
33
        rm -rf patch-stamp debian/patched
 
34
 
 
35
# Call this, if you got a CVS checkout to prepare the sources for configuration
 
36
configure: autoconf
25
37
autoconf:
26
38
        autoconf
27
39
 
28
40
        cd sources && aclocal && autoconf && . build 
29
 
        
 
41
 
30
42
        cd spm && aclocal && autoconf
31
43
 
32
 
build: build-stamp
 
44
build: patch build-stamp
33
45
build-stamp:
34
46
        dh_testdir
35
47
 
36
 
        # Add here commands to compile the package.
 
48
        # Add here commands to configure the package.
37
49
        chmod a+x configure */configure */*/configure
38
 
        ./configure --prefix=$(PREFIX) --with-realdir=$(REAL_DIR) --with-pike=/usr/bin/pike7.4 --with-config=/etc/steam --with-installdir=$(CURDIR)/$(INSTALL_DIR)
 
50
        ./configure --prefix=$(PREFIX) --with-realdir=$(REAL_DIR) \
 
51
          --with-pike=/usr/bin/$(PIKE) --with-config=/etc/steam \
 
52
          --with-installdir=$(CURDIR)/$(INSTALL_DIR) \
 
53
          --with-steamdir=/usr/share/steam
39
54
        cd sources && ./configure
40
 
        make
41
 
        
42
 
        # steam will be installed there
 
55
 
 
56
        # steam will be build there
43
57
        $(MAKE)
44
 
        #/usr/bin/docbook-to-man debian/steam.sgml > steam.1
45
58
        touch build-stamp
46
 
        
 
59
 
47
60
clean-cvs: clean
48
61
        -find -name CVS -type d -exec rm -rf {} \;
49
62
        -rm -rf $(INSTALL_DIR) $(INSTALL_LIBDIR) Makefile configure setup version 
50
 
        -rm -rf server/libraries/AbstractCallbacks.pike sources/aclocal.m4 sources/autom4te.cache sources/configure sources/libxslt/autom4te.cache sources/libxslt/configure sources/libxslt/Makefile sources/Makefile sources/wiki/autom4te.cache sources/wiki/configure sources/wiki/Makefile sources/_XML/autom4te.cache sources/_XML/configure sources/_XML/Makefile spm/aclocal.m4 spm/autom4te.cache spm/.in spm/spm server/libraries/*.so sources/wiki/wiki.so
51
 
        
52
 
clean: 
 
63
        -rm -rf server/libraries/AbstractCallbacks.pike sources/aclocal.m4 \
 
64
          sources/autom4te.cache sources/configure sources/libxslt/autom4te.cache \
 
65
          sources/libxslt/configure sources/libxslt/Makefile sources/Makefile \
 
66
          sources/wiki/autom4te.cache sources/wiki/configure \
 
67
          sources/wiki/Makefile sources/_XML/autom4te.cache \
 
68
          sources/_XML/configure sources/_XML/Makefile spm/aclocal.m4 \
 
69
          spm/autom4te.cache spm/.in spm/spm server/libraries/*.so \
 
70
          sources/wiki/wiki.so
 
71
 
 
72
clean: clean-patched unpatch
 
73
clean-patched: 
53
74
        dh_testdir
54
75
        dh_testroot
55
76
        -rm -f build-stamp
56
 
        # Add here commands to clean up after the build process.
57
 
        # The original Makefile deletes configure files, which should be
58
 
        # included in debian diffs. So clean manually
59
 
        #-$(MAKE) clean
60
 
        for a in sources; do ( if test -f $$a/Makefile; then cd $$a && $(MAKE) $(MAKE_FLAGS) clean; fi ); done
 
77
        -for a in sources; do ( if test -f $$a/Makefile; then cd $$a && $(MAKE) $(MAKE_FLAGS) clean; fi ); done
61
78
 
62
 
        -rm -rf server/libraries/AbstractCallbacks.pike sources/aclocal.m4 sources/autom4te.cache sources/libxslt/autom4te.cache sources/wiki/autom4te.cache sources/_XML/autom4te.cache spm/aclocal.m4 spm/autom4te.cache spm/.in server/libraries/*.so sources/wiki/wiki.so sources/libxslt/Makefile  sources/Makefile sources/wiki/Makefile sources/_XML/Makefile __tmp.tar
 
79
        -rm -rf server/libraries/AbstractCallbacks.pike sources/aclocal.m4 \
 
80
          sources/autom4te.cache sources/libxslt/autom4te.cache \
 
81
          sources/wiki/autom4te.cache sources/_XML/autom4te.cache \
 
82
          spm/aclocal.m4 spm/autom4te.cache spm/.in server/libraries/*.so \
 
83
          sources/wiki/wiki.so sources/libxslt/Makefile  sources/Makefile \
 
84
          sources/wiki/Makefile sources/_XML/Makefile __tmp.tar
63
85
 
64
86
        -find -name config.log -type f -exec rm -f {} \;
65
87
        -find -name config.status -type f -exec rm -f {} \;
71
93
        dh_clean -k
72
94
        dh_installdirs
73
95
 
74
 
        # Add here commands to install the package into debian/steam.
 
96
        # Prepare Directories
 
97
        mkdir -p $(INSTALL_DIR)/usr/share/doc/steam/examples    # Sample Configurations
 
98
        mkdir -p $(INSTALL_DIR)/usr/share/lintian/overrides     # Lintian overrides
 
99
        mkdir -p $(INSTALL_DIR)/var/lib/steam                   # chroot
 
100
        mkdir -p $(INSTALL_DIR)/var/log/steam                   # Logfiles
75
101
        mkdir -p $(INSTALL_DIR)/$(PREFIX)/$(REAL_DIR)
76
102
        mkdir -p $(INSTALL_LIBDIR)/$(PREFIX)/$(REAL_LIBDIR)/server/libraries/
77
103
 
 
104
        # Perform the actual installation
78
105
        $(MAKE) install DESTDIR=$(CURDIR)/$(INSTALL_DIR)
79
106
 
80
 
        # make a relative symlink
 
107
        # Links should be relative symlinks
81
108
        rm $(INSTALL_DIR)/$(PREFIX)/$(REAL_DIR)/steam
82
 
        ln -s -f ../../bin/pike7.4 $(INSTALL_DIR)/$(PREFIX)/$(REAL_DIR)/steam
83
109
 
84
 
        # lintian overrides
85
 
        install -m 755 -d $(INSTALL_DIR)/usr/share/lintian/overrides
 
110
        # install lintian overrides
86
111
        install -m 644 debian/steam.lintian.overrides $(INSTALL_DIR)/usr/share/lintian/overrides/steam
87
112
 
88
113
        # Fix Permissions
89
 
        find $(INSTALL_DIR)/$(PREFIX)/$(REAL_DIR) -type f -name '*.pike' -o -name '*.h' | xargs chmod 644 
 
114
        find $(INSTALL_DIR)/$(PREFIX)/$(REAL_DIR) -type f -name '*.pike' -o -name '*.h' -o -name '*.pmod' | xargs chmod 644 
90
115
        find $(INSTALL_DIR)/$(PREFIX)/$(REAL_DIR) -type d | xargs chmod 755
91
116
 
92
 
        cp debian/replacements/start $(INSTALL_DIR)/$(PREFIX)/$(REAL_DIR)
93
 
        cp debian/replacements/install $(INSTALL_DIR)/$(PREFIX)/$(REAL_DIR)
94
 
        cp debian/replacements/jail $(INSTALL_DIR)/$(PREFIX)/$(REAL_DIR)/bin
95
 
        chmod u+rwx $(INSTALL_DIR)/$(PREFIX)/$(REAL_DIR)/start
96
 
        chmod u+rwx $(INSTALL_DIR)/$(PREFIX)/$(REAL_DIR)/install
97
 
        chmod u+rwx $(INSTALL_DIR)/$(PREFIX)/$(REAL_DIR)/bin/jail
98
 
        
99
 
        mkdir -p $(INSTALL_DIR)/usr/share/doc/steam/examples
100
 
        cp debian/replacements/steam.cnf $(INSTALL_DIR)/usr/share/doc/steam/examples
101
 
        rm $(INSTALL_DIR)/etc/steam/steam.cnf
 
117
        chmod u+rx $(INSTALL_DIR)/$(PREFIX)/$(REAL_DIR)/start
 
118
        chmod u+rx $(INSTALL_DIR)/$(PREFIX)/$(REAL_DIR)/stop
 
119
        chmod 755 $(INSTALL_DIR)/usr/share/steam/tools/create_cert.pike
 
120
        chmod 755 $(INSTALL_DIR)/$(PREFIX)/$(REAL_DIR)/tools/debug.pike
 
121
 
 
122
        cp config.pike setup $(INSTALL_DIR)/$(PREFIX)/$(REAL_DIR)
 
123
        cp config/steam.cfg $(INSTALL_DIR)/usr/share/doc/steam/examples
 
124
 
 
125
        # Install modified files
 
126
        cp debian/replacements/configure.h $(INSTALL_DIR)/$(PREFIX)/$(REAL_DIR)/server/include
102
127
        cp debian/replacements/mount.txt $(INSTALL_DIR)/etc/steam
103
 
#       rm $(INSTALL_DIR)/etc/steam/*.tmp
104
 
 
105
 
        chmod 644 config.pike version
106
 
        cp config.pike version setup $(INSTALL_DIR)/$(PREFIX)/$(REAL_DIR)
107
 
        chmod 755 $(INSTALL_DIR)/$(PREFIX)/$(REAL_DIR)/tools/debug.pike
108
 
        chmod 644 $(INSTALL_DIR)/$(PREFIX)/$(REAL_DIR)/version
109
 
        
 
128
 
 
129
        # The configuration will be created by postinst.
 
130
        rm $(INSTALL_DIR)/etc/steam/steam.cfg
 
131
 
 
132
        # Remove the unneeded version file.
 
133
        rm $(INSTALL_DIR)/$(PREFIX)/$(REAL_DIR)/version
 
134
 
110
135
        # move libraries to the seperated steam-lib
111
136
        mv $(INSTALL_DIR)/$(PREFIX)/$(REAL_DIR)/server/libraries/xslt.so \
112
137
                $(INSTALL_DIR)/$(PREFIX)/$(REAL_DIR)/server/libraries/xml.so \
113
138
                $(INSTALL_DIR)/$(PREFIX)/$(REAL_DIR)/server/libraries/wiki.so \
114
139
                $(INSTALL_LIBDIR)/$(PREFIX)/$(REAL_LIBDIR)/server/libraries/
115
140
 
116
 
        ln -s -f ../../../../lib/steam/server/libraries/xml.so $(INSTALL_DIR)/$(PREFIX)/$(REAL_DIR)/server/libraries/
117
 
        ln -s -f ../../../../lib/steam/server/libraries/xslt.so $(INSTALL_DIR)/$(PREFIX)/$(REAL_DIR)/server/libraries/
118
 
        ln -s -f ../../../../lib/steam/server/libraries/wiki.so $(INSTALL_DIR)/$(PREFIX)/$(REAL_DIR)/server/libraries/
119
 
        ln -s -f ../bin/spm $(INSTALL_DIR)/$(PREFIX)/$(REAL_DIR)/spm/
120
 
 
121
 
        mkdir -p $(INSTALL_DIR)/var/log/steam
 
141
        # Replace Log directory under /usr/share/steam with a link to the
 
142
        # systemwide log directory in /var/log/steam
122
143
        rm -rf $(INSTALL_DIR)/$(PREFIX)/$(REAL_DIR)/logs
123
 
        ln -s -f /var/log/steam $(INSTALL_DIR)/$(PREFIX)/$(REAL_DIR)/logs
124
 
        chmod 640 $(INSTALL_DIR)/etc/steam/*
 
144
 
 
145
        # Prepare dbconfig-common files - these are dummy files to make sure the database is being created.
 
146
        mkdir -p $(INSTALL_DIR)/usr/share/dbconfig-common/data/steam/install/
 
147
        echo "status;" >> $(INSTALL_DIR)/usr/share/dbconfig-common/data/steam/install/mysql
125
148
 
126
149
 # Build architecture-independent files here.
127
150
 binary-indep: build install
129
152
 
130
153
 # Build architecture-dependent files here.
131
154
 binary-arch: build install
132
 
        dh_testdir
 
155
        # Checks if executed in the right directory
 
156
        dh_testdir                              
 
157
        # Checks if executed as root oder using fakeroot
133
158
        dh_testroot
 
159
        # Installs Debconf files
134
160
        dh_installdebconf
 
161
        # Installs Documentation
135
162
        dh_installdocs
136
 
 #      dh_installexamples
137
 
 #      dh_installmenu
138
 
 #      dh_installlogrotate
139
 
 #      dh_installemacsen
140
 
 #      dh_installpam
141
 
 #      dh_installmime
142
 
        dh_installinit -psteam -u "defaults 99"
143
 
 #      dh_installcron
144
 
 #      dh_installman
145
 
 #      dh_installinfo
146
 
 #      dh_undocumented
147
 
        dh_installdebconf
 
163
        # Installs init.d file, integrates it into runlevel 2 with priority 98
 
164
        # and start the daemon after the installation
 
165
        dh_installinit -u "defaults 98"
 
166
        # Installs Changelogs
148
167
        dh_installchangelogs
 
168
        # Creates all Symlinks (libs, directories, etc)
149
169
        dh_link
 
170
        # strip binaries
150
171
        dh_strip
 
172
        # compress files
151
173
        dh_compress
 
174
        # fix typical file permission
152
175
        dh_fixperms
153
 
 #      dh_makeshlibs
 
176
        # Install Debian files into Debian directory used by package management
154
177
        dh_installdeb
155
 
 #      dh_perl
 
178
        # calculate library dependencies
156
179
        dh_shlibdeps
 
180
        # generate control file with parameters
157
181
        dh_gencontrol -- -Vpike:ver=$(PIKE_VERSION) -Vpike:name=$(PIKE)
 
182
        # calculate checksums
158
183
        dh_md5sums
 
184
        # really build the debian packages
159
185
        dh_builddeb
160
186
 
161
187
 binary: binary-indep binary-arch