summaryrefslogtreecommitdiffstats
path: root/debian/rules
diff options
context:
space:
mode:
Diffstat (limited to 'debian/rules')
-rwxr-xr-xdebian/rules41
1 files changed, 41 insertions, 0 deletions
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..5f84d69
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,41 @@
+#!/usr/bin/make -f
+
+include /usr/share/dpkg/pkg-info.mk
+
+YACC := YACC=/usr/bin/byacc
+BOOTSTRAP := ASH=/bin/bash ECHO=/bin/echo MKDIR=/bin/mkdir CP=/bin/cp \
+ RM=/bin/rm INSTALL=/usr/bin/install $(YACC)
+SVNROOT := https://svn.netlabs.org/repos/kbuild/trunk
+REVISION := $(shell echo $(DEB_VERSION_UPSTREAM) | sed -e's,.*svn,,' | sed -e's,+dfsg.*,,')
+
+%:
+ dh $@
+
+override_dh_auto_configure:
+ echo "KBUILD_SVN_URL := $(SVNROOT)" > SvnInfo.kmk
+ echo "KBUILD_SVN_REV := $(REVISION)" >> SvnInfo.kmk
+
+override_dh_auto_build:
+ $(info DEBUG: macros defined by gcc:)
+ -gcc -dM -E - < /dev/null
+ kBuild/env.sh --full make -f bootstrap.gmk SRCDIR=`pwd` $(BOOTSTRAP)
+ kBuild/env.sh kmk rebuild PATH_INS=`pwd` KBUILD_VERBOSE=2 $(YACC)
+
+override_dh_auto_install:
+ kBuild/env.sh kmk install NIX_INSTALL_DIR=/usr KBUILD_VERBOSE=2
+
+override_dh_auto_clean:
+ -kBuild/env.sh kmk uninstall
+ rm -rf debian/stamp-* out kBuild/bin/*/* SvnInfo.kmk
+ ( cd src/kmk; rm -f aclocal.m4 config.h.in configure Makefile.in config/ar-lib )
+ ( cd src/kmk/config; rm -f compile config.guess config.sub depcomp install-sh Makefile.in missing )
+ rm -f src/kmk/glob/Makefile.in src/kmk/w32/Makefile.in
+ ( cd src/sed/config; rm -f intdiv0.m4 intmax.m4 inttypes_h.m4 inttypes.m4 inttypes-pri.m4 isc-posix.m4 longdouble.m4 longlong.m4 mkinstalldirs nls.m4 po.m4 printf-posix.m4 signed.m4 size_max.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4 wchar_t.m4 wint_t.m4 xsize.m4 )
+ ( cd src/sed/intl; rm -f libgnuintl.h.in localcharset.h log.c printf-args.c printf-args.h printf.c printf-parse.c printf-parse.h relocatable.c relocatable.h vasnprintf.c vasnprintf.h vasnwprintf.h wprintf-parse.h xsize.h )
+ ( cd src/sed/po; rm -f Makevars.template remove-potcdate.sin )
+
+get-orig-info:
+ svn info $(SVNROOT) | grep "Last Changed Rev:" | cut -d' ' -f4
+
+get-orig-source:
+ sh debian/orig-tar.sh $(SVNROOT) $(DEB_VERSION_UPSTREAM)