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 LIBWMAKER
:= libwmaker0
88 LIBWINGS
:= libwings-dev
89 LIBWINGS_TMP
:= $(DEBTMPDIR
)/..
/$(LIBWINGS
)
91 LTMAIN
:= $(shell: find
/usr
/share
/libtool
/ -name ltmain.sh | head
-1)
94 RMDIR
:= rmdir
--ignore-fail-on-non-empty
96 COMMON_OPTIONS
:= --prefix=$(BASEDIR
) \
98 --includedir=$(INCLUDEDIR
) \
99 --sysconfdir
=$(CONFDIR
) \
100 --datadir=$(SHAREDIR
) \
101 --with-nlsdir
=$(NLSDIR
) \
102 --with-pixmapdir
=$(PIXMAPDIR
) \
103 --with-gnustepdir
=$(GNUSTEPDIR
) \
106 AUTOMAKE_FILES
:= $(shell find
-name Makefile.am
)
107 IN_MAKEFILES
:= $(patsubst %.am
,%.in
,$(AUTOMAKE_FILES
))
108 IN_FILES
:= $(filter-out $(IN_MAKEFILES
),$(shell find
-name \
*.in
))
109 GEN_FILES
:= $(patsubst %.in
,%,$(IN_FILES
))
111 LIST_PATCHES
:= find debian
/patches
-mindepth
1 -maxdepth
1 -name \
*.diff
-type f |
sort
112 RLIST_PATCHES
:= find debian
/patches
-mindepth
1 -maxdepth
1 -name \
*.diff
-type f |
sort -r
114 install_file
:= install -p
-o root
-g root
-m
0644
115 install_prog
:= install -p
-o root
-g root
-m
0755
116 install_dir
:= install -p
-d
-o root
-g root
-m
0755
119 build-stamp
: build-wmaker-stamp
122 build-wmaker-stamp
: config-wmaker-stamp
123 $(RM
) $(patsubst %.in
,%,$(shell find WindowMaker
-name \
*.in
! -name Makefile.in
))
124 test -x libtool || ln
-sf
$(WMAKER_BD
)/libtool .
125 $(MAKE
) -C
$(WMAKER_BD
)
128 config-wmaker-stamp
: patch-wmaker-stamp configure
130 test -x config.guess || chmod
+x config.guess
131 test -x config.sub || chmod
+x config.sub
132 find
-name \
*.h.in | sed
-e
's/\.in$$//' | xargs
-r
rm -f
133 mkdir
-p
$(WMAKER_BD
)
135 LINGUAS
="$(LINGUAS)" $(TOPSRCDIR
)/configure
$(COMMON_OPTIONS
) \
136 $(WMAKER_OPTIONS
) CFLAGS
="$(CFLAGS)"
141 while read patch
; do \
143 if head
-1 $$patch | grep
-q ^Index
: ; then \
144 patch
-p0
< $$patch ; \
146 patch
-p1
< $$patch ; \
154 while read patch
; do \
156 if head
-1 $$patch | grep
-q ^Index
: ; then \
157 patch
--dry-run
-p0
< $$patch ; \
159 patch
--dry-run
-p1
< $$patch ; \
165 @if
[ -e patch-wmaker-stamp
] ; then \
167 while read patch
; do \
169 if head
-1 $$patch | grep
-q ^Index
: ; then \
170 patch
-p0
-R
< $$patch ; \
172 patch
-p1
-R
< $$patch ; \
176 rm patch-wmaker-stamp
; \
183 debian
/rules unpatch-wmaker
192 $(RM
) -r
$(WMAKER_BD
)
200 $(RM
) $(IN_MAKEFILES
) $(GEN_FILES
)
214 debian
/rules install-wmaker-stamp
215 debian
/rules debian
/$(LIBWRASTER
)-dev.files
216 debian
/rules debian
/$(LIBWRASTER
).files
217 debian
/rules debian
/$(LIBWMAKER
)-dev.files
218 debian
/rules debian
/$(LIBWINGS
).files
219 dh_movefiles
-a
--sourcedir
=debian
/wmaker
221 $(RM
) $(DEBTMPDIR
)/usr
/bin
/wkdemenu.pl
223 dh_installmenu
-a
--noscripts
224 $(install_prog
) debian
/appearance.menu-method \
225 $(DEBTMPDIR
)/etc
/menu-methods
/wmappearance
226 $(install_file
) WindowMaker
/appearance.menu \
227 $(DEBTMPDIR
)/$(WMCONFDIR
)/
228 $(install_file
) WindowMaker
/background.menu \
229 $(DEBTMPDIR
)/$(WMCONFDIR
)/
230 $(install_file
) WindowMaker
/wmmacros \
231 $(DEBTMPDIR
)/$(WMCONFDIR
)/
232 touch
$(DEBTMPDIR
)/$(WMCONFDIR
)/menu.prehook
233 touch
$(DEBTMPDIR
)/$(WMCONFDIR
)/menu.posthook
234 $(install_file
) debian
/wmaker.desktop
$(DEBTMPDIR
)/usr
/share
/xsessions
235 # build a conffiles list AFTER installing the menus
236 # the sed part is there because of policy
237 # -cd $(DEBTMPDIR) && \
238 # find etc ! -type d \
239 # | sed -e "s:^etc/:/etc/:" > ../conffiles
241 $(install_file
) $(WINGSSRCDIR
)/README \
242 $(LIBWINGS_TMP
)/$(DOCDIR
)/$(LIBWINGS
)/README.WINGs
243 $(install_file
) $(WRASTERSRCDIR
)/README \
244 $(LIBWRASTER_TMP
)/$(DOCDIR
)/$(LIBWRASTER
)/README.wrlib
245 $(install_dir
) $(DEBTMPDIR
)/$(MAN1DIR
)
246 $(RM
) $(DEBTMPDIR
)/$(MAN1DIR
)/convertstyle
*
247 dh_installman
-pwmaker debian
/manpages
/*.1x
248 dh_installman
-pwmaker debian
/manpages
/*.8
249 dh_installman
-plibwraster3-dev debian
/manpages
/get-wraster-flags
.1
250 dh_installman
-plibwings-dev debian
/manpages
/get-wings-flags
.1
251 dh_installman
-plibwings-dev debian
/manpages
/get-wutil-flags
.1
252 dh_installchangelogs
-a ChangeLog
256 cd debian
&& find
-name \
*.la
-exec chmod a-X
{} \
;
258 dh_makeshlibs
-p
$(LIBWRASTER
) -V
'$(LIBWRASTER) $(libwraster_deps)'
259 dh_shlibdeps
-u-L
$(LIBWRASTER_TMP
)/DEBIAN
/shlibs
260 dh_gencontrol
-a
-u-isp
262 find debian
-type d
-empty
-print0 | xargs
-0r
rm -rf
263 $(RMDIR
) $(DEBTMPDIR
)/$(INCLUDEDIR
)
266 binary
: binary-indep binary-arch
268 install-wmaker-stamp
: DH_OPTIONS
=-pwmaker
269 install-wmaker-stamp
: build-wmaker-stamp
272 $(MAKE
) -C
$(WMAKER_BD
) install DESTDIR
=$(DEBTMPDIR
)/
274 mv
$(DEBTMPDIR
)/etc
/WindowMaker
/* $(DEBTMPDIR
)/$(DEFAULTSDIR
)/
276 # Now begin fixing stuff
278 # First, provide a wrapper to compensate for Window Maker's funny first
279 # start up requierements
280 mv
$(DEBTMPDIR
)/$(BINDIR
)/wmaker
$(DEBTMPDIR
)/$(PKGLIBDIR
)/WindowMaker
281 dh_link
$(PKGLIBDIR
)/WindowMaker
$(BINDIR
)/WindowMaker
282 $(install_prog
) debian
/wmaker.sh
$(DEBTMPDIR
)/$(BINDIR
)/wmaker
284 -mv
$(DEBTMPDIR
)/$(BINDIR
)/convertfonts
$(DEBTMPDIR
)/$(PKGLIBDIR
)/
286 # place wm-oldmenu2new under a more appropiate directory
287 -mv
$(DEBTMPDIR
)/$(BINDIR
)/wm-oldmenu2new
$(DEBTMPDIR
)/$(WMDOCDIR
)
289 # put a symlink in place because there's some hardcoded value that says
290 # Defaults is under /usr/share/WindowMaker.
291 ln
-s
$(DEFAULTSDIR
) $(DEBTMPDIR
)/$(WMSHAREDIR
)/Defaults
292 # the next is stricly not necessary, because there's a symlink in place,
293 # but I don't want to abuse it. Some dumb program uses that path and is a
295 perl
-pi
-e
's:/$(WPREFSAPPDIR)/WPrefs:/$(BINDIR)/WPrefs:' \
296 $(DEBTMPDIR
)/$(DEFAULTSDIR
)/WMState
299 $(RM
) $(DEBTMPDIR
)/$(BINDIR
)/wmaker.inst
300 $(RM
) $(DEBTMPDIR
)/$(BINDIR
)/wmsetup
301 # this copyright is located in /$(DOCDIR)/wmaker
302 $(RM
) $(DEBTMPDIR
)/$(WMCONFDIR
)/Copyright
305 chmod
+x
$(DEBTMPDIR
)/usr
/share
/WindowMaker
/autostart.sh
306 chmod
+x
$(DEBTMPDIR
)/usr
/share
/WindowMaker
/exitscript.sh
308 # Install our transition script
309 $(install_prog
) debian
/upgrade-windowmaker-defaults \
310 $(DEBTMPDIR
)/usr
/sbin
/upgrade-windowmaker-defaults
312 # This file qualifies as "unpatchable"
313 cp debian
/WMWindowAttributes
$(DEBTMPDIR
)/$(DEFAULTSDIR
)/
314 # Need this file for start up
315 echo
'"menu.hook"' > $(DEBTMPDIR
)/$(DEFAULTSDIR
)/WMRootMenu
317 # the plethora of readmes
318 -cp
$(TOPSRCDIR
)/po
/README \
319 $(DEBTMPDIR
)/$(WMDOCDIR
)/README.po
320 -cp
$(TOPSRCDIR
)/README.definable-cursor \
321 $(DEBTMPDIR
)/$(WMDOCDIR
)/README.definable-cursor
322 -cp
$(WPREFSSRCDIR
)/README \
323 $(DEBTMPDIR
)/$(WMDOCDIR
)/README.WPrefs
324 -cp
$(WPREFSSRCDIR
)/po
/README \
325 $(DEBTMPDIR
)/$(WMDOCDIR
)/README.WPrefs.po
327 # Copy in the Debian theme
328 cp debian
/Debian.theme
$(DEBTMPDIR
)/$(WMSHAREDIR
)/Themes
/Debian
329 uudecode
-o
$(DEBTMPDIR
)/$(WMSHAREDIR
)/Backgrounds
/debian.tiff \
330 debian
/debian.tiff.uu
331 # This has the new default Debian theme settings.
332 cp debian
/WindowMaker.default
$(DEBTMPDIR
)/$(DEFAULTSDIR
)/WindowMaker
334 # Overrides lintian warnings
335 dh_installdirs usr
/share
/lintian
/overrides
336 cp debian
/wmaker.overrides debian
/wmaker
/usr
/share
/lintian
/overrides
/wmaker
339 # fix the location of WPrefs
340 # mv $(DEBTMPDIR)/$(WPREFSAPPDIR)/WPrefs $(DEBTMPDIR)/$(BINDIR)
341 # dh_link $(BINDIR)/WPrefs $(WPREFSAPPDIR)/WPrefs
342 dh_link
$(WPREFSAPPDIR
)/WPrefs
$(BINDIR
)/WPrefs
343 # libwraster is compiled with tiff support, we don't need the xpm version
344 $(RM
) -r
$(DEBTMPDIR
)/$(WPREFSAPPDIR
)/xpm
345 $(RM
) $(patsubst %.tiff
,%.xpm
,$(wildcard $(DEBTMPDIR
)/$(WMSHAREDIR
)/Icons
/*.tiff
))
347 # Fix the get-*-flags scripts
348 perl
-pi
-e
'/^WCFLAGS/ && s:=.*:="-I/usr/X11R6/include":; /^WLFLAGS/ && s:=.*:="-L/usr/X11R6/lib":;' `find $(DEBTMPDIR) -name get-*-flags`
349 perl
-pi
-e
'/^WLIBS/ && s:=.*:="-lwraster":' `find $(DEBTMPDIR) -name get-wraster-flags`
350 perl
-pi
-e
'/^WLIBS/ && s:=.*:="-lWINGs -lwraster -lXft":' `find $(DEBTMPDIR) -name get-wings-flags`
351 perl
-pi
-e
'/^WLIBS/ && s:=.*:="-lWUtil -lX11":' `find $(DEBTMPDIR) -name get-wutil-flags`
354 if
[ -d
$(DEBTMPDIR
)/usr
/include/WINGs
] ; then \
355 mv
$(DEBTMPDIR
)/usr
/include/WINGs
/* \
356 $(DEBTMPDIR
)/usr
/include ; \
357 rmdir
$(DEBTMPDIR
)/usr
/include/WINGs
; \
361 debian
/$(LIBWRASTER
)-dev.files
: build
362 ( find
$(DEBTMPDIR
)/$(INCLUDEDIR
) $(DEBTMPDIR
)/$(LIBDIR
) \
363 -name
'*wraster*.h' \
364 -o
-name
'*wraster*.a' \
365 -o
-name
'*wraster*.la' \
366 -o
-name
'*wraster*.so' ; \
368 find usr
-name get-wraster-flags \
369 ) | sed
-e
's:$(DEBTMPDIR)/*::'> $@
371 debian
/$(LIBWRASTER
).files
: build
372 ( find
$(DEBTMPDIR
)/$(INCLUDEDIR
) $(DEBTMPDIR
)/$(LIBDIR
) \
373 -name
'*wraster*.so.*' \
374 ) | sed
-e
's:$(DEBTMPDIR)/*::'> $@
376 debian
/$(LIBWMAKER
)-dev.files
: build
377 ( find
$(DEBTMPDIR
)/$(INCLUDEDIR
) $(DEBTMPDIR
)/$(LIBDIR
) \
382 ) | sed
-e
's:$(DEBTMPDIR)/*::'> $@
384 debian
/libwings-dev.files
: build
385 ( find
$(DEBTMPDIR
)/$(INCLUDEDIR
) $(DEBTMPDIR
)/$(LIBDIR
) \
387 -o
-name
'*WUtil*' | grep
-v
'\.so\.[0-9]' ; \
389 find usr
-name get-wutil-flags
-o
-name get-wings-flags \
390 ) | sed
-e
's:$(DEBTMPDIR)/*::'> $@
393 echo
'libwraster $(patsubst libwraster%,%, $(LIBWRASTER)) $(LIBWRASTER) $(libwraster_deps)' > $@
395 aclocal.m4
: acinclude.m4 configure.ac
398 src
/config.h.in
: configure.ac
401 ltmain.sh
: aclocal.m4
$(LTMAIN
)
402 libtoolize
--force --copy
--automake
404 $(IN_MAKEFILES
): %.in
: ltmain.sh
%.am src
/config.h.in
405 automake
--add-missing
--gnu
--include-deps
407 configure
: $(IN_MAKEFILES
) configure.ac
410 .PHONY
: binary binary-arch binary-indep binary-custom
clean build unpatch-wmaker