| 1 |
#!/usr/bin/make -f |
| 2 |
# See debhelper(7) (uncomment to enable) |
| 3 |
# output every command that modifies files on the build system. |
| 4 |
#export DH_VERBOSE = 1 |
| 5 |
|
| 6 |
|
| 7 |
# see FEATURE AREAS in dpkg-buildflags(1) |
| 8 |
#export DEB_BUILD_MAINT_OPTIONS = hardening=+all |
| 9 |
|
| 10 |
# see ENVIRONMENT in dpkg-buildflags(1) |
| 11 |
# package maintainers to append CFLAGS |
| 12 |
#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic |
| 13 |
# package maintainers to append LDFLAGS |
| 14 |
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed |
| 15 |
|
| 16 |
|
| 17 |
%: |
| 18 |
dh $@ |
| 19 |
|
| 20 |
override_dh_auto_configure: |
| 21 |
chmod a+x scripts/*.sh |
| 22 |
chmod a-x scripts/dice*.sh |
| 23 |
$(CURDIR)/debian/tools/search_for_data_in_code.py |
| 24 |
dh_auto_configure |
| 25 |
|
| 26 |
override_dh_auto_build: darknet.1 |
| 27 |
dh_auto_build -- OPENCV=1 |
| 28 |
|
| 29 |
override_dh_installexamples: |
| 30 |
dh_installexamples |
| 31 |
find $(CURDIR)/debian/darknet -name '*.debsave1*' -exec rm {} \; |
| 32 |
|
| 33 |
override_dh_auto_clean: |
| 34 |
$(CURDIR)/debian/tools/restore.py |
| 35 |
dh_auto_clean |
| 36 |
|
| 37 |
DB2MAN = /usr/share/sgml/docbook/stylesheet/xsl/docbook-xsl/manpages/docbook.xsl |
| 38 |
XP = xsltproc -''-nonet -''-param man.charmap.use.subset "0" |
| 39 |
|
| 40 |
darknet.1: debian/darknet.1.xml |
| 41 |
$(XP) $(DB2MAN) $< |
| 42 |
|
| 43 |
DEB_SOURCE := $(shell dpkg-parsechangelog | grep Source: | sed -e 's/Source: //') |
| 44 |
DEB_VERSION := $(shell dpkg-parsechangelog | grep Version: | sed -e 's/Version: //') |
| 45 |
DEB_UPSTREAM_VERSION := $(shell echo $(DEB_VERSION) | sed -e 's/-[^-]*$$//') |
| 46 |
GIT_URL = https://github.com/pjreddie/darknet.git |
| 47 |
|
| 48 |
|
| 49 |
get-orig-source: |
| 50 |
set -e; if echo $(DEB_VERSION) | grep -c "git"; \ |
| 51 |
then \ |
| 52 |
git_version=`echo $(DEB_VERSION) | sed -e 's/^.*git\([0-9]*\)*\.\(.*\)-.*$$/\2/g'`; \ |
| 53 |
else \ |
| 54 |
git_version=$(DEB_UPSTREAM_VERSION); \ |
| 55 |
fi; \ |
| 56 |
tmpdir=`mktemp -d -t`; \ |
| 57 |
cd $$tmpdir; \ |
| 58 |
echo "checkout upstream repository ..."; \ |
| 59 |
git clone $(GIT_URL); echo "getting specific upstream revision/tag: $$git_version"; \ |
| 60 |
cd `ls | head -n 1`; git checkout -b orig $$git_version; cd ..; \ |
| 61 |
tar --exclude=.git --exclude='*.exe' --exclude='*.jar' -cJvf $(CURDIR)/$(DEB_SOURCE)_$(DEB_UPSTREAM_VERSION).orig.tar.xz `ls | head -n 1`; \ |
| 62 |
cd $(CURDIR); \ |
| 63 |
rm -rf $$tmpdir |