File: rules

package info (click to toggle)
tdiary 2.0.1-1sarge1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 7,220 kB
  • ctags: 1,667
  • sloc: ruby: 20,044; lisp: 476; makefile: 91; sql: 32; sh: 31
file content (156 lines) | stat: -rwxr-xr-x 4,152 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# This is the debhelper compatibility version to use.
export DH_COMPAT=3

BUILDROOT=`pwd`/debian/tdiary
TDIARY=$(BUILDROOT)/usr/share/tdiary
WWW=$(BUILDROOT)/var/www/tdiary
MANDEST=$(BUILDROOT)/usr/share/man/man1

ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -g
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
	INSTALL_PROGRAM += -s
endif

configure: configure-stamp
configure-stamp:
	dh_testdir
	# Add here commands to configure the package.

	touch configure-stamp


build: build-stamp

build-stamp: configure-stamp 
	dh_testdir

	# Add here commands to compile the package.
	# $(MAKE) // no make
	/usr/bin/docbook-to-man debian/tdiary-setup.sgml > tdiary-setup.1
	/usr/bin/docbook-to-man debian/tdiary-convert2.sgml > tdiary-convert2.1

	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp configure-stamp

	# Add here commands to clean up after the build process.
	# -$(MAKE) clean // no make
	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

	# Add here commands to install the package into debian/tdiary.
	# --- Main files  ---
	install -m 644 tdiary.rb $(TDIARY)/
	install -m 755 index.rb $(TDIARY)/
	install -m 755 update.rb $(TDIARY)/
	install -m 644 ChangeLog $(TDIARY)/
	install -m 644 dot.htaccess $(TDIARY)/
	install -m 644 README $(TDIARY)/
	install -m 644 tdiary.conf.sample $(TDIARY)/
	cp -a misc skel plugin tdiary $(TDIARY)/
	cp -a contrib2 $(TDIARY)/contrib

	# docs
	install -m 644 doc/*     $(TDIARY)/doc
	rm -f $(TDIARY)/doc/COPYING
	cp -ar misc/i18n         $(TDIARY)/doc

	# --- copy themes ---
	install -m 755 theme/themebench.rhtml $(BUILDROOT)/usr/lib/cgi-bin/tdiary/theme
	cp -ar theme $(WWW)

	# --- debian original scripts
	cp -ar debian/debian-tools $(TDIARY)/
	install -m 644 debian/theme_url.rb        $(TDIARY)/plugin
	install -m 755 debian/tdiary-setup.rb     $(BUILDROOT)/usr/bin/tdiary-setup
	install -m 755 misc/convert2.rb           $(BUILDROOT)/usr/bin/tdiary-convert2
	install -m 644 debian/TC_tdiary-setup.rb  $(TDIARY)/

	# --- manpages ---
	install -m 644 tdiary-setup.1 $(MANDEST)
	install -m 644 tdiary-convert2.1 $(MANDEST)

	# Fix permission
	find $(WWW) -type f | xargs chmod 644
	chmod a+x $(TDIARY)/misc/plugin/windex.rb
	chmod a+x $(TDIARY)/misc/plugin/squeeze.rb
	chmod a+x $(TDIARY)/contrib/util/posttdiary/posttdiary.rb
	chmod a+x $(TDIARY)/contrib/util/tdiarysearch/search.rb
	chmod a+x $(TDIARY)/contrib/style/hatena/hatena_style.rb
	chmod a+x $(TDIARY)/contrib/util/posttdiary/posttdiary-ex.rb

	# --- Make tdiary-plugin.deb
	mv $(TDIARY)/misc/plugin/trackback/tb.rb $(TDIARY)/
	
	# --- Make tdiary-mode.deb
	install -m 644 $(TDIARY)/contrib/util/tdiary-mode/*.el \
	$(CURDIR)/debian/tdiary-mode/usr/share/emacs/site-lisp/tdiary-mode/
	rm -r $(TDIARY)/contrib/util/tdiary-mode/
  	
	# --- Make tdiary-{theme,plugin,contrib}.deb ---
	dh_movefiles --sourcedir=debian/tdiary

	# --- Remove files that are not included in tdiary.deb. ---
	# leave only $(WWW)/theme/'default' directory
	mv $(WWW)/theme/default $(WWW)/
	mv $(WWW)/theme/base.css $(WWW)/
	rm -r $(WWW)/theme/*
	mv $(WWW)/default $(WWW)/theme/
	mv $(WWW)/base.css $(WWW)/theme/


# Build architecture-independent files here.
binary-indep: build install
#	dh_testdir -i
	dh_testroot -i
#	dh_installdebconf -i
	dh_installdocs -i
	dh_installexamples -i
#	dh_installmenu -i
#	dh_installlogrotate -i
	dh_installemacsen -i --priority=50
#	dh_installpam -i
#	dh_installmime -i
#	dh_installinit -i
#	dh_installcron -i
	dh_installman -i
	dh_installinfo -i
#	dh_undocumented -i
	dh_installchangelogs ChangeLog
	dh_link -i
	dh_strip -i
	dh_compress -i
	dh_fixperms -i
#	dh_makeshlibs
	dh_installdeb -i
#	dh_perl
	dh_shlibdeps -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

# Build architecture-dependent files here.
binary-arch: build install

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure

manpage.1: manpage.sgml
	docbook-to-man $< > $@