2 # GNU Copyright 1997-2005 Marcelo Magallon <mmagallo@debian.org>
5 version
:= $(shell dpkg-parsechangelog | grep-dctrl
-ne
-sVersion
-FVersion .
)
7 # use '(>= some_version)' whenever version dependencies are needed
8 # libwraster_deps := (>= 0.90.0-1)
12 CFLAGS
= -g
-Wall
-DGLOBAL_DEFAULTS_SUBDIR
="\\\"GNUstep/Defaults\\\""
14 ifneq (,$(findstring noopt
,$(DEB_BUILD_OPTIONS
)))
20 ifneq (,$(findstring debug
,$(DEB_BUILD_OPTIONS
)))
24 LINGUAS
:= $(patsubst po
/%.po
, %, $(wildcard po
/*.po
))
25 #LINGUAS := $(filter-out zh_TW.Big5, $(LINGUAS))
27 # Options, options and more options!!!
29 XLOCALE
:= --disable-locale
30 MODELOCK
:= --enable-modelock
32 XINERAMA
:= --enable-xinerama
34 # USERMENU := --enable-usermenu
36 # SHAPE_EXT := --disable-shape
37 # USE_SHM := --disable-shm
39 # USE_XPM := --disable-xpm
40 # USE_PNG := --disable-png
41 # USE_JPEG := --disable-jpeg
42 # USE_GIF := --disable-gif
43 # USE_TIFF := --disable-tiff
45 WMAKER_OPTIONS
:= $(XLOCALE
) $(MODELOCK
) $(XINERAMA
) \
46 $(USERMENU
) $(SHAPE_EXT
) $(USE_SHM
) \
47 $(USE_XPM
) $(USE_PNG
) $(USE_JPEG
) $(USE_GIF
) $(USE_TIFF
)
49 TOPSRCDIR
:= $(shell pwd
)
50 DEBTMPDIR
:= $(TOPSRCDIR
)/debian
/wmaker
53 WMAKER_BD
:= $(TOPSRCDIR
)/$(WMAKER
)
54 WMAKER_TMP
:= $(DEBTMPDIR
)
56 # Be careful with the leading / because some of these values are going
57 # to be hardcoded into the executables
61 BINDIR
:= $(BASEDIR
)/bin
62 INCLUDEDIR
:= $(BASEDIR
)/include
63 SHAREDIR
:= $(BASEDIR
)/share
64 DOCDIR
:= $(SHAREDIR
)/doc
65 MANDIR
:= $(SHAREDIR
)/man
66 MAN1DIR
:= $(MANDIR
)/man1
67 MAN8DIR
:= $(MANDIR
)/man8
68 LIBDIR
:= $(BASEDIR
)/lib
69 PKGLIBDIR
:= $(BASEDIR
)/lib
/WindowMaker
70 NLSDIR
:= $(SHAREDIR
)/locale
71 WMCONFDIR
:= $(CONFDIR
)/X11
/WindowMaker
72 WMSHAREDIR
:= $(SHAREDIR
)/WindowMaker
73 WMDOCDIR
:= $(DOCDIR
)/wmaker
74 GNUSTEPDIR
:= $(LIBDIR
)/GNUstep
/System
75 GNUSTEPCONFDIR
:= $(CONFDIR
)/GNUstep
76 DEFAULTSDIR
:= $(GNUSTEPCONFDIR
)/Defaults
77 PIXMAPDIR
:= $(INCLUDEDIR
)/X11
/pixmaps
78 GNUSTEPAPPS
:= $(GNUSTEPDIR
)/Applications
79 WPREFSAPPDIR
:= $(GNUSTEPAPPS
)/WPrefs.app
81 WPREFSSRCDIR
:= $(TOPSRCDIR
)/WPrefs.app
82 WRASTERSRCDIR
:= $(TOPSRCDIR
)/wrlib
83 WINGSSRCDIR
:= $(TOPSRCDIR
)/WINGs
85 LIBWRASTER
:= libwraster3
86 LIBWRASTER_TMP
:= $(DEBTMPDIR
)/..
/$(LIBWRASTER
)
87 LIBWINGS
:= libwings-dev
88 LIBWINGS_TMP
:= $(DEBTMPDIR
)/..
/$(LIBWINGS
)
90 LTMAIN
:= $(shell: find
/usr
/share
/libtool
/ -name ltmain.sh | head
-1)
93 RMDIR
:= rmdir
--ignore-fail-on-non-empty
95 COMMON_OPTIONS
:= --prefix=$(BASEDIR
) \
97 --includedir=$(INCLUDEDIR
) \
98 --sysconfdir
=$(CONFDIR
) \
99 --datadir=$(SHAREDIR
) \
100 --with-nlsdir
=$(NLSDIR
) \
101 --with-pixmapdir
=$(PIXMAPDIR
) \
102 --with-gnustepdir
=$(GNUSTEPDIR
) \
105 AUTOMAKE_FILES
:= $(shell find
-name Makefile.am
)
106 IN_MAKEFILES
:= $(patsubst %.am
,%.in
,$(AUTOMAKE_FILES
))
107 IN_FILES
:= $(filter-out $(IN_MAKEFILES
),$(shell find
-name \
*.in
))
108 GEN_FILES
:= $(patsubst %.in
,%,$(IN_FILES
))
110 LIST_PATCHES
:= find debian
/patches
-mindepth
1 -maxdepth
1 -name \
*.diff
-type f |
sort
111 RLIST_PATCHES
:= find debian
/patches
-mindepth
1 -maxdepth
1 -name \
*.diff
-type f |
sort -r
113 install_file
:= install -p
-o root
-g root
-m
0644
114 install_prog
:= install -p
-o root
-g root
-m
0755
115 install_dir
:= install -p
-d
-o root
-g root
-m
0755
118 build-stamp
: build-wmaker-stamp
121 build-wmaker-stamp
: config-wmaker-stamp
122 $(RM
) $(patsubst %.in
,%,$(shell find WindowMaker
-name \
*.in
! -name Makefile.in
))
123 test -x libtool || ln
-sf
$(WMAKER_BD
)/libtool .
124 $(MAKE
) -C
$(WMAKER_BD
)
127 config-wmaker-stamp
: patch-wmaker-stamp configure
129 test -x config.guess || chmod
+x config.guess
130 test -x config.sub || chmod
+x config.sub
131 find
-name \
*.h.in | sed
-e
's/\.in$$//' | xargs
-r
rm -f
132 mkdir
-p
$(WMAKER_BD
)
134 LINGUAS
="$(LINGUAS)" $(TOPSRCDIR
)/configure
$(COMMON_OPTIONS
) \
135 $(WMAKER_OPTIONS
) CFLAGS
="$(CFLAGS)"
140 while read patch
; do \
142 if head
-1 $$patch | grep
-q ^Index
: ; then \
143 patch
-p0
< $$patch ; \
145 patch
-p1
< $$patch ; \
153 while read patch
; do \
155 if head
-1 $$patch | grep
-q ^Index
: ; then \
156 patch
--dry-run
-p0
< $$patch ; \
158 patch
--dry-run
-p1
< $$patch ; \
164 @if
[ -e patch-wmaker-stamp
] ; then \
166 while read patch
; do \
168 if head
-1 $$patch | grep
-q ^Index
: ; then \
169 patch
-p0
-R
< $$patch ; \
171 patch
-p1
-R
< $$patch ; \
175 rm patch-wmaker-stamp
; \
182 debian
/rules unpatch-wmaker
191 $(RM
) -r
$(WMAKER_BD
)
199 $(RM
) $(IN_MAKEFILES
) $(GEN_FILES
)
213 debian
/rules install-wmaker-stamp
214 debian
/rules debian
/$(LIBWRASTER
)-dev.files
215 debian
/rules debian
/$(LIBWRASTER
).files
216 debian
/rules debian
/$(LIBWINGS
).files
217 dh_movefiles
-a
--sourcedir
=debian
/wmaker
219 $(RM
) $(DEBTMPDIR
)/usr
/bin
/wkdemenu.pl
221 dh_installmenu
-a
--noscripts
222 $(install_prog
) debian
/appearance.menu-method \
223 $(DEBTMPDIR
)/etc
/menu-methods
/wmappearance
224 $(install_file
) WindowMaker
/appearance.menu \
225 $(DEBTMPDIR
)/$(WMCONFDIR
)/
226 $(install_file
) WindowMaker
/background.menu \
227 $(DEBTMPDIR
)/$(WMCONFDIR
)/
228 $(install_file
) WindowMaker
/wmmacros \
229 $(DEBTMPDIR
)/$(WMCONFDIR
)/
230 touch
$(DEBTMPDIR
)/$(WMCONFDIR
)/menu.prehook
231 touch
$(DEBTMPDIR
)/$(WMCONFDIR
)/menu.posthook
232 $(install_file
) debian
/wmaker.desktop
$(DEBTMPDIR
)/usr
/share
/xsessions
233 # build a conffiles list AFTER installing the menus
234 # the sed part is there because of policy
235 # -cd $(DEBTMPDIR) && \
236 # find etc ! -type d \
237 # | sed -e "s:^etc/:/etc/:" > ../conffiles
239 $(install_file
) $(WINGSSRCDIR
)/README \
240 $(LIBWINGS_TMP
)/$(DOCDIR
)/$(LIBWINGS
)/README.WINGs
241 $(install_file
) $(WRASTERSRCDIR
)/README \
242 $(LIBWRASTER_TMP
)/$(DOCDIR
)/$(LIBWRASTER
)/README.wrlib
243 $(install_dir
) $(DEBTMPDIR
)/$(MAN1DIR
)
244 $(RM
) $(DEBTMPDIR
)/$(MAN1DIR
)/convertstyle
*
245 dh_installman
-pwmaker debian
/manpages
/*.1x
246 dh_installman
-pwmaker debian
/manpages
/*.8
247 dh_installman
-plibwraster3-dev debian
/manpages
/get-wraster-flags
.1
248 dh_installman
-plibwings-dev debian
/manpages
/get-wings-flags
.1
249 dh_installman
-plibwings-dev debian
/manpages
/get-wutil-flags
.1
250 dh_installchangelogs
-a ChangeLog
254 cd debian
&& find
-name \
*.la
-exec chmod a-X
{} \
;
256 dh_makeshlibs
-p
$(LIBWRASTER
) -V
'$(LIBWRASTER) $(libwraster_deps)'
257 dh_shlibdeps
-u-L
$(LIBWRASTER_TMP
)/DEBIAN
/shlibs
258 dh_gencontrol
-a
-u-isp
260 find debian
-type d
-empty
-print0 | xargs
-0r
rm -rf
261 $(RMDIR
) $(DEBTMPDIR
)/$(INCLUDEDIR
)
264 binary
: binary-indep binary-arch
266 install-wmaker-stamp
: DH_OPTIONS
=-pwmaker
267 install-wmaker-stamp
: build-wmaker-stamp
270 $(MAKE
) -C
$(WMAKER_BD
) install DESTDIR
=$(DEBTMPDIR
)/
272 mv
$(DEBTMPDIR
)/etc
/WindowMaker
/* $(DEBTMPDIR
)/$(DEFAULTSDIR
)/
274 # Now begin fixing stuff
276 # First, provide a wrapper to compensate for Window Maker's funny first
277 # start up requierements
278 mv
$(DEBTMPDIR
)/$(BINDIR
)/wmaker
$(DEBTMPDIR
)/$(PKGLIBDIR
)/WindowMaker
279 dh_link
$(PKGLIBDIR
)/WindowMaker
$(BINDIR
)/WindowMaker
280 $(install_prog
) debian
/wmaker.sh
$(DEBTMPDIR
)/$(BINDIR
)/wmaker
282 -mv
$(DEBTMPDIR
)/$(BINDIR
)/convertfonts
$(DEBTMPDIR
)/$(PKGLIBDIR
)/
284 # place wm-oldmenu2new under a more appropiate directory
285 -mv
$(DEBTMPDIR
)/$(BINDIR
)/wm-oldmenu2new
$(DEBTMPDIR
)/$(WMDOCDIR
)
287 # put a symlink in place because there's some hardcoded value that says
288 # Defaults is under /usr/share/WindowMaker.
289 ln
-s
$(DEFAULTSDIR
) $(DEBTMPDIR
)/$(WMSHAREDIR
)/Defaults
290 # the next is stricly not necessary, because there's a symlink in place,
291 # but I don't want to abuse it. Some dumb program uses that path and is a
293 perl
-pi
-e
's:/$(WPREFSAPPDIR)/WPrefs:/$(BINDIR)/WPrefs:' \
294 $(DEBTMPDIR
)/$(DEFAULTSDIR
)/WMState
297 $(RM
) $(DEBTMPDIR
)/$(BINDIR
)/wmaker.inst
298 $(RM
) $(DEBTMPDIR
)/$(BINDIR
)/wmsetup
299 # this copyright is located in /$(DOCDIR)/wmaker
300 $(RM
) $(DEBTMPDIR
)/$(WMCONFDIR
)/Copyright
303 chmod
+x
$(DEBTMPDIR
)/usr
/share
/WindowMaker
/autostart.sh
304 chmod
+x
$(DEBTMPDIR
)/usr
/share
/WindowMaker
/exitscript.sh
306 # Install our transition script
307 $(install_prog
) debian
/upgrade-windowmaker-defaults \
308 $(DEBTMPDIR
)/usr
/sbin
/upgrade-windowmaker-defaults
310 # This file qualifies as "unpatchable"
311 cp debian
/WMWindowAttributes
$(DEBTMPDIR
)/$(DEFAULTSDIR
)/
312 # Need this file for start up
313 echo
'"menu.hook"' > $(DEBTMPDIR
)/$(DEFAULTSDIR
)/WMRootMenu
315 # the plethora of readmes
316 -cp
$(TOPSRCDIR
)/po
/README \
317 $(DEBTMPDIR
)/$(WMDOCDIR
)/README.po
318 -cp
$(TOPSRCDIR
)/README.definable-cursor \
319 $(DEBTMPDIR
)/$(WMDOCDIR
)/README.definable-cursor
320 -cp
$(WPREFSSRCDIR
)/README \
321 $(DEBTMPDIR
)/$(WMDOCDIR
)/README.WPrefs
322 -cp
$(WPREFSSRCDIR
)/po
/README \
323 $(DEBTMPDIR
)/$(WMDOCDIR
)/README.WPrefs.po
325 # Copy in the Debian theme
326 cp debian
/Debian.theme
$(DEBTMPDIR
)/$(WMSHAREDIR
)/Themes
/Debian
327 uudecode
-o
$(DEBTMPDIR
)/$(WMSHAREDIR
)/Backgrounds
/debian.tiff \
328 debian
/debian.tiff.uu
329 # This has the new default Debian theme settings.
330 cp debian
/WindowMaker.default
$(DEBTMPDIR
)/$(DEFAULTSDIR
)/WindowMaker
332 # Overrides lintian warnings
333 dh_installdirs usr
/share
/lintian
/overrides
334 cp debian
/wmaker.overrides debian
/wmaker
/usr
/share
/lintian
/overrides
/wmaker
337 # fix the location of WPrefs
338 # mv $(DEBTMPDIR)/$(WPREFSAPPDIR)/WPrefs $(DEBTMPDIR)/$(BINDIR)
339 # dh_link $(BINDIR)/WPrefs $(WPREFSAPPDIR)/WPrefs
340 dh_link
$(WPREFSAPPDIR
)/WPrefs
$(BINDIR
)/WPrefs
341 # libwraster is compiled with tiff support, we don't need the xpm version
342 $(RM
) -r
$(DEBTMPDIR
)/$(WPREFSAPPDIR
)/xpm
343 $(RM
) $(patsubst %.tiff
,%.xpm
,$(wildcard $(DEBTMPDIR
)/$(WMSHAREDIR
)/Icons
/*.tiff
))
345 # Fix the get-*-flags scripts
346 perl
-pi
-e
'/^WCFLAGS/ && s:=.*:="-I/usr/X11R6/include":; /^WLFLAGS/ && s:=.*:="-L/usr/X11R6/lib":;' `find $(DEBTMPDIR) -name get-*-flags`
347 perl
-pi
-e
'/^WLIBS/ && s:=.*:="-lwraster":' `find $(DEBTMPDIR) -name get-wraster-flags`
348 perl
-pi
-e
'/^WLIBS/ && s:=.*:="-lWINGs -lwraster -lXft":' `find $(DEBTMPDIR) -name get-wings-flags`
349 perl
-pi
-e
'/^WLIBS/ && s:=.*:="-lWUtil -lX11":' `find $(DEBTMPDIR) -name get-wutil-flags`
352 if
[ -d
$(DEBTMPDIR
)/usr
/include/WINGs
] ; then \
353 mv
$(DEBTMPDIR
)/usr
/include/WINGs
/* \
354 $(DEBTMPDIR
)/usr
/include ; \
355 rmdir
$(DEBTMPDIR
)/usr
/include/WINGs
; \
359 debian
/$(LIBWRASTER
)-dev.files
: build
360 ( find
$(DEBTMPDIR
)/$(INCLUDEDIR
) $(DEBTMPDIR
)/$(LIBDIR
) \
361 -name
'*wraster*.h' \
362 -o
-name
'*wraster*.a' \
363 -o
-name
'*wraster*.la' \
364 -o
-name
'*wraster*.so' ; \
366 find usr
-name get-wraster-flags \
367 ) | sed
-e
's:$(DEBTMPDIR)/*::'> $@
369 debian
/$(LIBWRASTER
).files
: build
370 ( find
$(DEBTMPDIR
)/$(INCLUDEDIR
) $(DEBTMPDIR
)/$(LIBDIR
) \
371 -name
'*wraster*.so.*' \
372 ) | sed
-e
's:$(DEBTMPDIR)/*::'> $@
374 debian
/libwings-dev.files
: build
375 ( find
$(DEBTMPDIR
)/$(INCLUDEDIR
) $(DEBTMPDIR
)/$(LIBDIR
) \
377 -o
-name
'*WUtil*' | grep
-v
'\.so\.[0-9]' ; \
379 find usr
-name get-wutil-flags
-o
-name get-wings-flags \
380 ) | sed
-e
's:$(DEBTMPDIR)/*::'> $@
383 echo
'libwraster $(patsubst libwraster%,%, $(LIBWRASTER)) $(LIBWRASTER) $(libwraster_deps)' > $@
385 aclocal.m4
: acinclude.m4 configure.ac
388 src
/config.h.in
: configure.ac
391 ltmain.sh
: aclocal.m4
$(LTMAIN
)
392 libtoolize
--force --copy
--automake
394 $(IN_MAKEFILES
): %.in
: ltmain.sh
%.am src
/config.h.in
395 automake
--add-missing
--gnu
--include-deps
397 configure
: $(IN_MAKEFILES
) configure.ac
400 .PHONY
: binary binary-arch binary-indep binary-custom
clean build unpatch-wmaker