summaryrefslogtreecommitdiffstats
path: root/dist/debian/rules
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-11 08:21:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-11 08:21:29 +0000
commit29cd838eab01ed7110f3ccb2e8c6a35c8a31dbcc (patch)
tree63ef546b10a81d461e5cf5ed9e98a68cd7dee1aa /dist/debian/rules
parentInitial commit. (diff)
downloadkbuild-29cd838eab01ed7110f3ccb2e8c6a35c8a31dbcc.tar.xz
kbuild-29cd838eab01ed7110f3ccb2e8c6a35c8a31dbcc.zip
Adding upstream version 1:0.1.9998svn3589+dfsg.upstream/1%0.1.9998svn3589+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dist/debian/rules')
-rwxr-xr-xdist/debian/rules56
1 files changed, 56 insertions, 0 deletions
diff --git a/dist/debian/rules b/dist/debian/rules
new file mode 100755
index 0000000..22995b6
--- /dev/null
+++ b/dist/debian/rules
@@ -0,0 +1,56 @@
+#!/usr/bin/make -f
+
+include /usr/share/cdbs/1/rules/debhelper.mk
+include /usr/share/cdbs/1/rules/patchsys-quilt.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)
+
+ifdef KBUILD_FROM_SVN
+SVNROOT := http://svn.netlabs.org/repos/kbuild/trunk
+REVISION := $(shell echo $(DEB_UPSTREAM_VERSION) | sed -e's,.*svn,,')
+
+makebuilddir:: SvnInfo.kmk
+SvnInfo.kmk:
+ echo "KBUILD_SVN_URL := $(SVNROOT)" > $@
+ echo "KBUILD_SVN_REV := $(REVISION)" >> $@
+endif
+
+build/kbuild:: debian/stamp-build
+debian/stamp-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` $(YACC)
+ pod2man -c 'kBuild for Debian GNU/Linux' \
+ -r kBuild-$(DEB_UPSTREAM_VERSION) debian/kmk.pod > debian/kmk.1
+ touch $@
+
+install/kbuild::
+ kBuild/env.sh kmk install NIX_INSTALL_DIR=/usr \
+ MY_INST_DOC=share/doc/kbuild/ LDFLAGS=-Wl,--as-needed
+
+clean::
+ -kBuild/env.sh kmk uninstall
+ $(RM) -r debian/stamp-* debian/kmk.1 out kBuild/bin/*/*
+ifdef KBUILD_FROM_SVN
+ $(RM) SvnInfo.kmk
+endif
+
+## @todo fetch from ftp://ftp.netlabs.org/pub/kbuild or
+## ftp://ftp.netlabs.org/incoming/kbuild when KBUILD_FROM_SVN isn't
+## defined... (fetch the kBuild-x.y.z-src.tar.gz file)
+
+ifdef KBUILD_FROM_SVN
+get-orig-info:
+ svn info $(SVNROOT)
+
+get-orig-source:
+ sh debian/orig-tar.sh $(SVNROOT) $(DEB_UPSTREAM_VERSION) $(REVISION)
+else
+get-orig-source:
+ wget -O ../tarballs/kbuild_$(DEB_UPSTREAM_VERSION).orig.tar.gz \
+ ftp://ftp.netlabs.org/incoming/kbuild/kBuild-$(DEB_UPSTREAM_VERSION)-src.tar.gz
+endif
+