~jderose/+junk/couchdb-1.6.0-packaging-artful

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
#!/usr/bin/make -f

export DEB_CFLAGS_MAINT_APPEND=-w

%:
	dh $@ --with autoreconf,systemd

override_dh_auto_clean:
	dh_auto_clean
	rm -f $(CURDIR)/debian/couchdb.init

override_dh_auto_configure:
	dh_auto_configure
	sed -i s/%package_author_name%/`lsb_release -si`/ etc/couchdb/default.ini.tpl
	sed -i s/%version%/`lsb_release -sr`/ etc/couchdb/default.ini.tpl

override_dh_auto_install:
	dh_auto_install
	chmod 0640 debian/tmp/etc/couchdb/local.ini
	chmod 0750 debian/tmp/etc/couchdb/local.d
	chmod 0750 debian/tmp/var/lib/couchdb
	chmod 0750 debian/tmp/var/log/couchdb
	rm -f debian/tmp/usr/lib/couchdb/erlang/lib/couch-*/priv/lib/couch_erl_driver.la
	sed -i "/dependency_libs/ s/'.*'/''/" `find debian/tmp -name '*.la'`
	cp $(CURDIR)/etc/init/couchdb $(CURDIR)/debian/couchdb.init

override_dh_gencontrol:
	erlang-depends
	dh_gencontrol

get-packaged-orig-source:
	uscan --noconf --download-current-version --destdir=. --rename