diff options
Diffstat (limited to 'support-files/debian/rules')
-rwxr-xr-x | support-files/debian/rules | 169 |
1 files changed, 169 insertions, 0 deletions
diff --git a/support-files/debian/rules b/support-files/debian/rules new file mode 100755 index 00000000000..e63f144a655 --- /dev/null +++ b/support-files/debian/rules @@ -0,0 +1,169 @@ +#!/usr/bin/make -f +# Made with the aid of debmake, by Christoph Lameter, +# based on the sample debian/rules file for GNU hello by Ian Jackson. + +package=mysql +CHARSET=ujis +TEMPINST=build + +#CFLAGS="-O6 -mpentium -mstack-align-double -fomit-frame-pointer" CXX=gcc CXXFLAGS="-O6 -mpentium -mstack-align-double -fomit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --enable-assembler --with-mysqld-ldflags=-all-static + +CC=gcc +CFLAGS=-O6 -fomit-frame-pointer +CXX=gcc +CXXFLAGS=-O6 -fomit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti +# CXXFLAGS=-O6 -fomit-frame-pointer -felide-constructors -fno-rtti + +SYSNAME= +COMMONCONF= --prefix=/usr --libexecdir=/usr/sbin \ + --localstatedir=/var/mysql/data \ + --enable-shared \ + --without-perl --without-readline \ + --without-docs --without-bench \ + --with-mysqld-user=mysql \ + --with-extra-charsets=all + +SERVERCONF=$(COMMONCONF) --enable-assembler \ + --with-raid + +# --with-berkeley-db-includes=/usr/include/db3 \ +# --with-berkeley-db-libs=/usr/lib/libdb3.a + +STATICCONF=--with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static + +CLIENTCONF=$(COMMONCONF) --without-server + +################################################## +patches debian/stamp-patches: + -test -e debian/stamp-patches || \ + for i in `find debian/patches -type f -print` ; do \ + patch -p1 < $$i ; \ + done + touch debian/stamp-patches + +################################################## +premkdir debian/stamp-premkdir: + $(checkdir) + -rm -rf debian/tmp debian/$(TEMPINST)* + dh_installdirs + -install -d debian/$(TEMPINST)/usr/{bin,sbin,share,man,include,info} + -install -d debian/$(TEMPINST)-shared/usr/{bin,sbin,share,man,include,info} + -install -d debian/$(TEMPINST)-debug/usr/{bin,sbin,share,man,include,info} + touch debian/stamp-premkdir + +################################################## +config debian/stamp-config: debian/stamp-premkdir debian/stamp-patches + CC=$(CC) CFLAGS="$(CFLAGS)" CXX=$(CXX) CXXFLAGS="$(CXXFLAGS)" \ + LDFLAGS="-static" \ + ./configure $(SERVERCONF) $(STATICCONF) \ + --with-charset=$(CHARSET) \ + --with-bench \ + $(SYSNAME) +# sed 's/-fno-implicit-templates//g' sql/Makefile > .m +# mv .m sql/Makefile + touch debian/stamp-config + +################################################## +build: debian/stamp-config + make LDFLAGS="-static" + make install DESTDIR=`pwd`/debian/$(TEMPINST) + cp include/m_ctype.h `pwd`/debian/$(TEMPINST)/usr/include/mysql/ + touch build + +################################################## +build-shared debian/stamp-build-shared: debian/stamp-patches + -make distclean + CC=$(CC) CFLAGS="$(CFLAGS)" CXX=$(CXX) CXXFLAGS="$(CXXFLAGS)" \ + ./configure $(SERVERCONF) \ + --with-charset=$(CHARSET) \ + $(SYSNAME) + +# ./configure $(CLIENTCONF) + + make + make install DESTDIR=`pwd`/debian/$(TEMPINST)-shared + + touch debian/stamp-build-shared + +################################################## +build-debug debian/stamp-build-debug: debian/stamp-patches + -make distclean + CC=$(CC) CFLAGS="$(CFLAGS)" CXX=$(CXX) CXXFLAGS="$(CXXFLAGS)" \ + ./configure $(SERVERCONF) \ + --with-charset=$(CHARSET) \ + --with-debug \ + $(SYSNAME) + +# ./configure $(CLIENTCONF) + + make + make install DESTDIR=`pwd`/debian/$(TEMPINST)-debug + + touch debian/stamp-build-debug + +################################################## +clean: + $(checkdir) + -make distclean + -test -e debian/stamp-patches && \ + for i in `find debian/patches -type f -print` ; do \ + patch -R -p1 < $$i ; \ + done + -rm -rf build debian/stamp-* debian/$(TEMPINST)* + -dh_clean + -rm -f `find . -name "*~"` + -rm -rf debian/tmp debian/files* core + -rm -f debian/*substvars + -rm -f `cat debian/gomi` + +################################################## +binary-indep: checkroot build + $(checkdir) +# There are no architecture-independent files to be uploaded +# generated by this package. If there were any they would be +# made here. + +binary-arch: checkroot build debian/stamp-build-shared debian/stamp-build-debug + sh debian/move + +### init, post* + dh_installdeb + cp debian/shlibs debian/libmysqlclient9/DEBIAN/ + + cp debian/my.cnf debian/mysql-server/etc/ + cp support-files/mysql.server debian/mysql-server/etc/init.d/mysql ; chmod +x debian/mysql-server/etc/init.d/mysql + +### dpkg-xxx + dh_compress + + dh_fixperms + + dh_strip + + dh_shlibdeps + dh_gencontrol + + dpkg --build debian/libmysqlclient9 .. + dpkg --build debian/mysql-client .. + dpkg --build debian/mysql-server .. + dpkg --build debian/mysql-server-shared .. + dpkg --build debian/mysql-server-debug .. + dpkg --build debian/mysql-dev .. + dpkg --build debian/mysql-bench .. + dpkg --build debian/mysql-doc .. + +define checkdir + test -f debian/rules +endef + +# Below here is fairly generic really + +binary: binary-indep binary-arch + +################################################## +checkroot: + $(checkdir) + test root = "`whoami`" + +################################################## +.PHONY: binary binary-arch binary-indep clean checkroot |