1#*************************************************************************
2#
3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4#
5# Copyright 2000, 2010 Oracle and/or its affiliates.
6#
7# OpenOffice.org - a multi-platform office productivity suite
8#
9# This file is part of OpenOffice.org.
10#
11# OpenOffice.org is free software: you can redistribute it and/or modify
12# it under the terms of the GNU Lesser General Public License version 3
13# only, as published by the Free Software Foundation.
14#
15# OpenOffice.org is distributed in the hope that it will be useful,
16# but WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18# GNU Lesser General Public License version 3 for more details
19# (a copy is included in the LICENSE file that accompanied this code).
20#
21# You should have received a copy of the GNU Lesser General Public License
22# version 3 along with OpenOffice.org.  If not, see
23# <http://www.openoffice.org/license.html>
24# for a copy of the LGPLv3 License.
25#
26#*************************************************************************
27
28PRJ=..$/..
29
30PRJNAME=sysui
31TARGET=slackware
32
33# --- Settings -----------------------------------------------------
34
35.INCLUDE :  settings.mk
36
37# --- Product Version Information ----------------------------------
38
39.INCLUDE :  ../productversion.mk
40
41# --- Files --------------------------------------------------------
42
43MENUFILES=$(PKGDIR)$/{$(PRODUCTLIST)}3.4-$(TARGET)-menus-$(PKGVERSION)-noarch-$(PKGREV).tgz
44
45# --- Targets -------------------------------------------------------
46
47.INCLUDE :  target.mk
48
49.IF "$(OS)" == "LINUX"
50
51ALLTAR : $(MENUFILES)
52
53$(MISC)/$(TARGET)/usr/share/applications/ :
54	@$(MKDIRHIER) $(@)
55
56# --- slackware-specific stuff ------------------------------------
57# symlinks shall not be included in the tarball, but created with the doinst-script
58
59# FIXME: removal of *-extension.* only to create identical packages to OOF680
60%/usr/share/applications :
61	@$(MKDIRHIER) $@
62	/bin/sh -c "cd $(COMMONMISC)$/$(*:b:s/-/ /:1:s/3.4//); DESTDIR=$(shell @cd $*; pwd) GNOMEDIR="" ICON_PREFIX=$(ICONPREFIX.$(*:b:s/-/ /:1:s/3.4//)) KDEMAINDIR=/opt/kde .$/create_tree.sh"
63	$(RM) $*$/opt$/kde$/share$/icons$/*$/*$/*$/*-extension.png
64	$(RM) $*$/opt$/kde$/share$/mimelnk$/application$/*-extension.desktop
65	$(RM) $*$/usr$/share$/applications$/*.desktop
66	$(RM) $*$/usr$/bin$/soffice
67
68%$/install$/doinst.sh : update-script
69	@echo "( cd etc ; rm -rf $(UNIXFILENAME.$(*:b:s/-/ /:1:s/3.4//)) )" > $@
70	@echo "( cd etc ; ln -snf /opt/$(UNIXFILENAME.$(*:b:s/-/ /:1:s/3.4//):s/-//) $(UNIXFILENAME.$(*:b:s/-/ /:1:s/3.4//)) )" >> $@
71	@echo "( cd usr/bin ; rm -rf soffice )" >> $@
72	@echo "( cd usr/bin ; ln -sf /etc/$(UNIXFILENAME.$(*:b:s/-/ /:1:s/3.4//))/program/soffice soffice )" >> $@
73	@echo -e $(foreach,i,$(shell @cat $(COMMONMISC)$/$(*:b:s/-/ /:1:s/3.4//)/launcherlist) "\n( cd usr/share/applications ; rm -rf $(UNIXFILENAME.$(*:b:s/-/ /:1:s/3.4//))-$i )\n( cd usr/share/applications ; ln -sf /etc/$(UNIXFILENAME.$(*:b:s/-/ /:1:s/3.4//))/share/xdg/$i $(UNIXFILENAME.$(*:b:s/-/ /:1:s/3.4//))-$i )") >> $@
74	@cat $< >> $@
75
76%$/install$/slack-desc : slack-desc
77	@$(MKDIRHIER) $(@:d)
78	@sed -e "s/PKGNAME/$(*:b:s/-/ /:1:s/3.4//)-$(TARGET)-menus/g" -e "s/PKGVERSION/$(PKGVERSION.$(*:b:s/-/ /:1:s/3.4//))/g" \
79		-e "s/LONGPRODUCTNAME/$(PRODUCTNAME.$(*:b:s/-/ /:1:s/3.4//)) $(PRODUCTVERSION.$(*:b:s/-/ /:1:s/3.4//))/g" \
80		-e "s/PRODUCTNAME/$(PRODUCTNAME.$(*:b:s/-/ /:1:s/3.4//))/g" \
81		-e "s/UNIXFILENAME/$(UNIXFILENAME.$(*:b:s/-/ /:1:s/3.4//))/g" $< > $@
82
83# needed to satisfy the slackware package tools - they need
84# the entries like this
85#       ./              <- very important
86#       directory/file
87# the follwoing does not work (no description found then):
88#       ./
89#       ./directory/file
90# and this doesn't work either (broken file-list, package cannot be removed)
91#       directory/file
92
93$(MISC)/$(TARGET)/empty.tar :
94	@$(MKDIRHIER) $(@:d)/empty
95	@tar -C $(MISC)/$(TARGET)/empty --owner=root --group=root --same-owner -cf $@ .
96
97
98# --- packaging ---------------------------------------------------
99
100$(MENUFILES) : makefile.mk slack-desc update-script $(COMMONMISC)$/{$(PRODUCTLIST)}$/build.flag
101$(MENUFILES) : $(MISC)/$(TARGET)/empty.tar
102	@-$(MKDIRHIER) $(@:d)
103	-$(RM) $(@:d)$/$(@:b:s/-/ /:1)-$(TARGET)-menus-*.tgz
104	-$(RM) -r $(MISC)$/$(@:b)
105	dmake $(MISC)$/$(@:b)$/usr/share/applications $(MISC)$/$(@:b)$/install$/slack-desc $(MISC)$/$(@:b)$/install$/doinst.sh
106	@$(COPY) $(MISC)/$(TARGET)$/empty.tar $@.tmp
107	@tar -C $(MISC)/$(@:b) --owner=root --group=root --same-owner --exclude application.flag -rf $@.tmp install usr opt
108	@gzip < $@.tmp > $@
109	@$(RM) $@.tmp
110	$(RM) -r $(MISC)$/$(@:b)
111
112.ENDIF
113