1 #*************************************************************************
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 # Copyright 2008 by Sun Microsystems, Inc.
7 # OpenOffice.org - a multi-platform office productivity suite
9 # $RCSfile: makefile.mk,v $
13 # This file is part of OpenOffice.org.
15 # OpenOffice.org is free software: you can redistribute it and/or modify
16 # it under the terms of the GNU Lesser General Public License version 3
17 # only, as published by the Free Software Foundation.
19 # OpenOffice.org is distributed in the hope that it will be useful,
20 # but WITHOUT ANY WARRANTY; without even the implied warranty of
21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 # GNU Lesser General Public License version 3 for more details
23 # (a copy is included in the LICENSE file that accompanied this code).
25 # You should have received a copy of the GNU Lesser General Public License
26 # version 3 along with OpenOffice.org. If not, see
27 # <http://www.openoffice.org/license.html>
28 # for a copy of the LGPLv3 License.
30 #*************************************************************************
40 # --- Settings -----------------------------------------------------
42 .INCLUDE
: settings.mk
44 # --- Product Version Information ----------------------------------
46 .INCLUDE
: ..
/productversion.mk
48 # --- Files --------------------------------------------------------
50 .IF
"$(PKGFORMAT)"!="$(PKGFORMAT:s/deb//)"
52 DEBFILES
=$(foreach,i
,{$(PRODUCTLIST
)} $(PKGDIR
)$/$i3.2
-$(TARGET
)-menus_
$(PKGVERSION.
$i)-$(PKGREV
)_all.deb
)
56 # --- Targets -------------------------------------------------------
60 .IF
"$(PKGFORMAT)"!="$(PKGFORMAT:s/deb//)"
65 %/DEBIAN
/control
: $$(@
:f
)
66 @
$(MKDIRHIER
) $(@
:d
) $*$/etc
$*$/usr
/share
/applnk
/Office
$*$/usr
/lib
/menu
67 ln
-sf
/opt
/$(UNIXFILENAME.
$(*:f
:s
/-/ /:1:s
/3.2//)) $*$/etc
$/
68 /bin
/sh
-c
-x
"cd $(COMMONMISC)$/$(*:f:s/-/ /:1:s/3.2//) && DESTDIR=$(shell @cd $*; pwd) ICON_PREFIX=$(ICONPREFIX) KDEMAINDIR=/usr GNOMEDIR=/usr create_tree.sh"
69 @cat openoffice.org-debian-menus | sed
-e
's/%PRODUCTNAME/$(PRODUCTNAME.$(*:f:s/-/ /:1:s/3.2//)) $(PRODUCTVERSION.$(*:f:s/-/ /:1:s/3.2//))/' -e
's/%PREFIX/$(UNIXFILENAME.$(*:f:s/-/ /:1:s/3.2//))/' -e
's/%ICONPREFIX/$(ICONPREFIX.$(*:f:s/-/ /:1:s/3.2//))/' > $*$/usr
/lib
/menu
/$(*:f
:s
/_
/ /:1:s
/3.2//)
70 echo
"Package: $(*:f:s/_/ /:1:s/3.2//)" > $@
71 cat
$(@
:f
) | tr
-d
"\015" | sed
"s/%productname/$(PRODUCTNAME.$(*:f:s/-/ /:1:s/3.2//))/" >> $@
72 echo
"Version: $(PKGVERSION.$(*:f:s/-/ /:1:s/3.2//))-$(PKGREV)" >> $@
73 @du
-k
-s
$* | awk
-F
' ' '{ printf "Installed-Size: %s\n", $$1 ; }' >> $@
75 %/DEBIAN
/postinst
: $$(@
:f
)
76 @cat
$< | tr
-d
"\015" | sed
-e
"s/%PREFIX/$(UNIXFILENAME.$(*:f:s/-/ /:1:s/3.2//))/g" > $@
78 %/DEBIAN
/postrm
: $$(@
:f
)
79 @cat
$< | tr
-d
"\015" | sed
-e
"s/%PREFIX/$(UNIXFILENAME.$(*:f:s/-/ /:1:s/3.2//))/g" > $@
81 %/DEBIAN
/prerm
: $$(@
:f
)
82 @cat
$< | tr
-d
"\015" | sed
-e
"s/%PREFIX/$(UNIXFILENAME.$(*:f:s/-/ /:1:s/3.2//))/g" > $@
84 # --- packaging ---------------------------------------------------
86 # getuid.so fakes the user/group for us
87 $(DEBFILES
) : $(COMMONMISC
)$/{$(PRODUCTLIST
)}$/build.flag
88 $(DEBFILES
) : makefile.mk control postinst postrm prerm
89 -$(RM
) $(@
:d
)$(@
:f
:s
/_
/ /:1)_
*
90 $(RM
) -r
$(MISC
)$/$(@
:b
)
91 dmake
$(MISC
)$/$(@
:b
)$/DEBIAN
$/{control postinst postrm prerm
}
92 @chmod
-R g-w
$(MISC
)$/$(@
:b
)
93 @chmod a
+rx
$(MISC
)$/$(@
:b
)$/DEBIAN
$(MISC
)/$(@
:b
)/DEBIAN
/post
* $(MISC
)/$(@
:b
)/DEBIAN
/pre
*
94 @chmod g-s
$(MISC
)/$(@
:b
)/DEBIAN
96 /bin
/bash
-c
"LD_PRELOAD=$(SOLARBINDIR)/getuid.so dpkg-deb --build $(MISC)/$(@:b) $@"
97 $(RM
) -r
$(MISC
)$/$(@
:b
)
98 # @chmod -R g+w $(MISC)/$(TARGET)/$(DEBFILE:f)