2 # GNU Copyright 1997-2005 Marcelo Magallon <mmagallo@debian.org>
6 version
:= $(shell dpkg-parsechangelog | grep-dctrl
-ne
-sVersion
-FVersion .
)
9 CFLAGS
= -g
-Wall
-DGLOBAL_DEFAULTS_SUBDIR
="\\\"GNUstep/Defaults\\\""
11 ifneq (,$(findstring noopt
,$(DEB_BUILD_OPTIONS
)))
17 ifneq (,$(findstring debug
,$(DEB_BUILD_OPTIONS
)))
21 # These are used for cross-compiling and for saving the configure script
22 # from having to guess our platform (since we know it already)
23 export DEB_HOST_GNU_TYPE ?
= $(shell dpkg-architecture
-qDEB_HOST_GNU_TYPE
)
24 export DEB_BUILD_GNU_TYPE ?
= $(shell dpkg-architecture
-qDEB_BUILD_GNU_TYPE
)
26 ifeq ($(DEB_BUILD_GNU_TYPE
),$(DEB_HOST_GNU_TYPE
))
27 HOSTSPEC
:= --build
$(DEB_HOST_GNU_TYPE
)
29 HOSTSPEC
:= --build
$(DEB_BUILD_GNU_TYPE
) --host
$(DEB_HOST_GNU_TYPE
)
32 LINGUAS
:= $(patsubst po
/%.po
, %, $(wildcard po
/*.po
))
34 XLOCALE
:= --disable-locale
35 MODELOCK
:= --enable-modelock
36 XINERAMA
:= --enable-xinerama
37 # USERMENU := --enable-usermenu
38 # SHAPE_EXT := --disable-shape
39 # USE_SHM := --disable-shm
40 # USE_XPM := --disable-xpm
41 # USE_PNG := --disable-png
42 # USE_JPEG := --disable-jpeg
43 # USE_GIF := --disable-gif
44 # USE_TIFF := --disable-tiff
46 WMAKER_OPTIONS
:= $(XLOCALE
) $(MODELOCK
) $(XINERAMA
) \
47 $(USERMENU
) $(SHAPE_EXT
) $(USE_SHM
) \
48 $(USE_XPM
) $(USE_PNG
) $(USE_JPEG
) $(USE_GIF
) $(USE_TIFF
) \
51 TOPSRCDIR
:= $(shell pwd
)
54 WMAKER_COMMON
:= wmaker-common
55 WMAKER_DBG
:= wmaker-dbg
56 LIBWRASTER
:= libwraster3
57 LIBWRASTERDEV
:= $(LIBWRASTER
)-dev
58 LIBWINGS
:= libwings-dev
60 # Be careful with the leading / because some of these values are going
61 # to be hardcoded into the executables
64 BINDIR
:= $(BASEDIR
)/bin
65 INCLUDEDIR
:= $(BASEDIR
)/include
66 SHAREDIR
:= $(BASEDIR
)/share
67 DOCDIR
:= $(SHAREDIR
)/doc
68 MANDIR
:= $(SHAREDIR
)/man
69 MAN1DIR
:= $(MANDIR
)/man1
70 MAN8DIR
:= $(MANDIR
)/man8
71 LIBDIR
:= $(SHAREDIR
)/lib
72 PKGLIBDIR
:= $(SHAREDIR
)/lib
/WindowMaker
73 NLSDIR
:= $(SHAREDIR
)/locale
74 WMCONFDIR
:= $(CONFDIR
)/X11
/WindowMaker
75 WMSHAREDIR
:= $(SHAREDIR
)/WindowMaker
76 WMDOCDIR
:= $(DOCDIR
)/wmaker
77 GNUSTEPDIR
:= $(LIBDIR
)/GNUstep
/System
78 GNUSTEPCONFDIR
:= $(CONFDIR
)/GNUstep
79 DEFAULTSDIR
:= $(GNUSTEPCONFDIR
)/Defaults
80 PIXMAPDIR
:= $(INCLUDEDIR
)/X11
/pixmaps
81 GNUSTEPAPPS
:= $(GNUSTEPDIR
)/Applications
82 WPREFSAPPDIR
:= $(GNUSTEPAPPS
)/WPrefs.app
84 WPREFSSRCDIR
:= $(TOPSRCDIR
)/WPrefs.app
85 WRASTERSRCDIR
:= $(TOPSRCDIR
)/wrlib
86 WINGSSRCDIR
:= $(TOPSRCDIR
)/WINGs
88 DEBDIR
:= $(TOPSRCDIR
)/debian
89 DEBDIR_TMP
:= $(DEBDIR
)/tmp
91 WMAKER_TMP
:= $(DEBDIR
)/$(WMAKER
)
92 WMAKER_COMMON_TMP
:= $(DEBDIR
)/$(WMAKER_COMMON
)
93 WMAKER_DBG_TMP
:= $(DEBDIR
)/$(WMAKER_DBG
)
94 LIBWRASTER_TMP
:= $(DEBDIR
)/$(LIBWRASTER
)
95 LIBWRASTERDEV_TMP
:= $(DEBDIR
)/$(LIBWRASTERDEV
)
96 LIBWINGS_TMP
:= $(DEBDIR
)/$(LIBWINGS
)
100 COMMON_OPTIONS
:= --prefix=$(BASEDIR
) \
102 --includedir=$(INCLUDEDIR
) \
103 --sysconfdir
=$(CONFDIR
) \
104 --datadir=$(SHAREDIR
) \
105 --with-nlsdir
=$(NLSDIR
) \
106 --with-pixmapdir
=$(PIXMAPDIR
) \
107 --with-gnustepdir
=$(GNUSTEPDIR
)
109 install_file
:= install -p
-o root
-g root
-m
0644
110 install_prog
:= install -p
-o root
-g root
-m
0755
115 override_dh_auto_configure
:
116 $(TOPSRCDIR
)/autogen.sh
117 ifneq "$(wildcard /usr/share/misc/config.sub)" ""
118 cp
-f
/usr
/share
/misc
/config.sub config.sub
120 ifneq "$(wildcard /usr/share/misc/config.guess)" ""
121 cp
-f
/usr
/share
/misc
/config.guess config.guess
123 LINGUAS
="$(LINGUAS)" $(TOPSRCDIR
)/configure
$(COMMON_OPTIONS
) \
124 $(WMAKER_OPTIONS
) CFLAGS
="$(CFLAGS)"
128 # rm the file WMRootMenu, added by WindowMaker/Defaults/Makefile
129 $(RM
) WindowMaker
/Defaults
/WMRootMenu
130 # quilt (I do not why is not automatically)
131 QUILT_PATCHES
=debian
/patches quilt pop
-a
-R ||
test $$?
= 2
133 override_dh_installmenu
:
134 dh_installmenu
-a
--noscripts
135 $(install_prog
) $(DEBDIR
)/appearance.menu-method \
136 $(WMAKER_TMP
)/etc
/menu-methods
/wmappearance
137 $(install_file
) $(TOPSRCDIR
)/WindowMaker
/appearance.menu \
138 $(WMAKER_TMP
)/$(WMCONFDIR
)/
139 $(install_file
) $(TOPSRCDIR
)/WindowMaker
/background.menu \
140 $(WMAKER_TMP
)/$(WMCONFDIR
)/
141 $(install_file
) $(TOPSRCDIR
)/WindowMaker
/wmmacros \
142 $(WMAKER_TMP
)/$(WMCONFDIR
)/
143 touch
$(WMAKER_TMP
)/$(WMCONFDIR
)/menu.prehook
144 touch
$(WMAKER_TMP
)/$(WMCONFDIR
)/menu.posthook
145 chmod
755 $(WMAKER_TMP
)/etc
/menu-methods
/wmaker
147 override_dh_installdocs
:
149 $(install_file
) $(WINGSSRCDIR
)/README \
150 $(LIBWINGS_TMP
)/$(DOCDIR
)/$(LIBWINGS
)/README.WINGs
151 $(install_file
) $(WRASTERSRCDIR
)/README \
152 $(LIBWRASTER_TMP
)/$(DOCDIR
)/$(LIBWRASTER
)/README.wrlib
154 $(install_file
) $(DEBDIR
)/copyright \
155 $(WMAKER_COMMON_TMP
)/$(DOCDIR
)/$(WMAKER_COMMON
)/
158 override_dh_installchangelogs
:
160 dh_installchangelogs ChangeLog upstream
164 dh_strip
-a
--dbg-package
=$(WMAKER_DBG
)
165 mv
$(DEBDIR_TMP
)/etc
/WindowMaker
/* $(WMAKER_COMMON_TMP
)/$(DEFAULTSDIR
)/
166 rmdir
$(DEBDIR_TMP
)/etc
/WindowMaker
168 # Now begin fixing stuff
169 $(install_file
) $(DEBDIR
)/wmaker-common.desktop
$(WMAKER_COMMON_TMP
)/usr
/share
/xsessions
171 # First, provide a wrapper to compensate for Window Maker's funny first
172 # start up requierements
174 # WMaker and WMaker debug
175 mv
$(WMAKER_TMP
)/$(BINDIR
)/wmaker \
176 $(WMAKER_TMP
)/usr
/lib
/WindowMaker
/WindowMaker
177 mv
$(WMAKER_DBG_TMP
)/usr
/lib
/debug
$(BINDIR
)/wmaker \
178 $(WMAKER_DBG_TMP
)/usr
/lib
/debug
/usr
/lib
/WindowMaker
/WindowMaker
180 # convertfonts and convertfonts debug
181 mv
$(WMAKER_TMP
)/$(BINDIR
)/convertfonts \
182 $(WMAKER_TMP
)/usr
/lib
/WindowMaker
/
183 mv
$(WMAKER_DBG_TMP
)/usr
/lib
/debug
$(BINDIR
)/convertfonts \
184 $(WMAKER_DBG_TMP
)/usr
/lib
/debug
/usr
/lib
/WindowMaker
/
187 mv
$(DEBDIR_TMP
)/$(WPREFSAPPDIR
)/WPrefs \
188 $(WMAKER_TMP
)/usr
/lib
/GNUstep
/System
/Applications
/WPrefs.app
/WPrefs
190 $(install_prog
) $(DEBDIR
)/wmaker.sh
$(WMAKER_COMMON_TMP
)/$(BINDIR
)/wmaker
192 # place wm-oldmenu2new under a more appropiate directory
193 -mv
$(DEBDIR_TMP
)/$(BINDIR
)/wm-oldmenu2new
$(WMAKER_COMMON_TMP
)/$(WMDOCDIR
)
195 # the next is stricly not necessary, because there's a symlink in place,
196 # but I don't want to abuse it. Some dumb program uses that path and is a
198 perl
-pi
-e
's:/$(WPREFSAPPDIR)/WPrefs:/$(BINDIR)/WPrefs:' \
199 $(WMAKER_COMMON_TMP
)/$(DEFAULTSDIR
)/WMState
202 chmod
+x
$(WMAKER_COMMON_TMP
)/usr
/share
/WindowMaker
/autostart.sh
203 chmod
+x
$(WMAKER_COMMON_TMP
)/usr
/share
/WindowMaker
/exitscript.sh
205 # Install our transition script
206 $(install_prog
) $(DEBDIR
)/upgrade-windowmaker-defaults \
207 $(WMAKER_COMMON_TMP
)/usr
/sbin
/upgrade-windowmaker-defaults
209 # This file qualifies as "unpatchable"
210 cp
$(DEBDIR
)/WMWindowAttributes
$(WMAKER_COMMON_TMP
)/$(DEFAULTSDIR
)/
211 # Need this file for start up
212 echo
'"menu.hook"' > $(WMAKER_COMMON_TMP
)/$(DEFAULTSDIR
)/WMRootMenu
214 # the plethora of readmes
215 cp
$(TOPSRCDIR
)/po
/README \
216 $(WMAKER_COMMON_TMP
)/$(WMDOCDIR
)/README.po
217 cp
$(TOPSRCDIR
)/README.definable-cursor \
218 $(WMAKER_COMMON_TMP
)/$(WMDOCDIR
)/README.definable-cursor
219 cp
$(WPREFSSRCDIR
)/README \
220 $(WMAKER_COMMON_TMP
)/$(WMDOCDIR
)/README.WPrefs
221 cp
$(WPREFSSRCDIR
)/po
/README \
222 $(WMAKER_COMMON_TMP
)/$(WMDOCDIR
)/README.WPrefs.po
224 # Copy in the Debian theme
225 cp
$(DEBDIR
)/Debian.theme
$(WMAKER_COMMON_TMP
)/$(WMSHAREDIR
)/Themes
/Debian
226 uudecode
-o
$(WMAKER_COMMON_TMP
)/$(WMSHAREDIR
)/Backgrounds
/debian.tiff \
227 $(DEBDIR
)/debian.tiff.uu
228 # This has the new default Debian theme settings.
229 cp
$(DEBDIR
)/WindowMaker.default
$(WMAKER_COMMON_TMP
)/$(DEFAULTSDIR
)/WindowMaker
231 # Fix the get-*-flags scripts
232 perl
-pi
-e
'/^WCFLAGS/ && s:=.*:="-I/usr/X11R6/include":; /^WLFLAGS/ && s:=.*:="-L/usr/X11R6/lib":;' `find $(LIBWRASTERDEV_TMP) -name get-*-flags`
233 perl
-pi
-e
'/^WCFLAGS/ && s:=.*:="-I/usr/X11R6/include":; /^WLFLAGS/ && s:=.*:="-L/usr/X11R6/lib":;' `find $(LIBWINGS_TMP) -name get-*-flags`
234 perl
-pi
-e
'/^WLIBS/ && s:=.*:="-lwraster":' `find $(LIBWRASTERDEV_TMP) -name get-wraster-flags`
235 perl
-pi
-e
'/^WLIBS/ && s:=.*:="-lWINGs -lwraster -lXft":' `find $(LIBWINGS_TMP) -name get-wings-flags`
236 perl
-pi
-e
'/^WLIBS/ && s:=.*:="-lWUtil -lX11":' `find $(LIBWINGS_TMP) -name get-wutil-flags`