File: rules

package info (click to toggle)
debconf-kde 0.2-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 524 kB
  • sloc: cpp: 1,176; makefile: 25; sh: 3
file content (42 lines) | stat: -rwxr-xr-x 2,003 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/make -f

export DH_ALWAYS_EXCLUDE = .git

# Stuff for get-orig-source.
# Getting the revision numbers according to debian/changelog, the HARD way.
upstream_version := $(shell dpkg-parsechangelog | sed -ne 's/^Version: \(.*\)-.*/\1/p')
isodate := $(shell dpkg-parsechangelog | sed -ne 's/^Version.*git\(.*\)-.*/\1/p')
unixdate := $(shell date -d $(isodate) +%s)
# Add 24 hours to the Unix time.
unixdate := $(shell expr $(unixdate) + 86400 )

%:
	dh $@ --parallel --with kde --dbg-package=debconf-kde-dbg

override_dh_install:
	dh_install --list-missing

get-orig-source:
	# Cleaning up
	rm -rf debconf-kde-$(upstream_version)
	rm -f ../debconf-kde_$(upstream_version).orig.tar.gz

	# Download the latest Git revision and downgrade it to $(isodate).
	git clone git://anongit.kde.org/libdebconf-kde debconf-kde-$(upstream_version)
	cd debconf-kde-$(upstream_version) && git reset --hard $(shell cd debconf-kde-$(upstream_version) && \
									git rev-list --all -n 1 --before=$(unixdate))

	# Fetch translations from KDE SVN
	mkdir -p debconf-kde-$(upstream_version)/po
	cd debconf-kde-$(upstream_version)/po; svn export svn://anonsvn.kde.org/home/kde/trunk/l10n-kde4/subdirs
	cd debconf-kde-$(upstream_version)/po; for asdf in `cat subdirs`; do mkdir -p $${asdf}; done
	cd debconf-kde-$(upstream_version)/po; for asdf in `cat subdirs`; do echo $${asdf}; cd $${asdf}; svn export svn://anonsvn.kde.org/home/kde/trunk/l10n-kde4/$${asdf}/messages/extragear-sysadmin/libdebconf-kde.po; cd ..; done
	cd debconf-kde-$(upstream_version)/po; rm subdirs; rmdir --ignore-fail-on-non-empty */
	cd debconf-kde-$(upstream_version) && git add ./po && git commit -m "Included translations"

	# Make a pristine package.
	mkdir -p ../origtar/
	cd debconf-kde-$(upstream_version) && git archive --format=tar --prefix=debconf-kde-$(upstream_version)/ master | gzip -9 --no-name > \
		../../origtar/debconf-kde_$(upstream_version).orig.tar.gz
	# Remove temporary workspace
	rm -rf debconf-kde-$(upstream_version)