-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
132 lines (114 loc) · 4.44 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# Rolf Niepraschk, [email protected]
# If you have TeX Live installed somewhere other than the default
# location, change this variable accordingly
TL_PATH = /usr/local/texlive
NAME = texlive-dummy
YEAR = 2024
VERSION = $(YEAR).9999
RELEASE = 2
DATE = "2024/11/16"
PACKAGE_NAME=$(NAME)-$(VERSION)-$(RELEASE)
# TODO: Problem "Package header is not signed!" (createrepo?)
DESCRIPTION = \
'This is a "dummy-package" which achieves the dependencies of the\
\nopenSUSE TeX Live packages without installing the real files. This\
\nmakes it possible to install the original TeX Live distribution\
\n(http://www.tug.org/texlive/) without the overhead of the openSUSE\
\npackages. The "dummy-package" provides scripts in `/etc/profile.d/`\
\nfor setting the correct paths of the TeX Live binaries.\
The installation\npath is assumed to be `/usr/local/texlive/YYYY`\
(`YYYY` means the year\nof the TeX Live release). In addition,\
the path `/usr/local/texlive/current`\nis supported \
(e.g. a symbolic link to the path with year). \n\nInstall this package \
with:\n\n`zypper in --allow-unsigned-rpm $(PACKAGE_NAME).noarch.rpm`'
BUILD_ROOT = $(PWD)/rpmbuild/###
all : rpm srpm
rpm : clean init $(NAME).spec README.md zzz-texlive.sh zzz-texlive.csh
rpmbuild --define "_topdir $(BUILD_ROOT)" -bb $(NAME).spec
mv $(BUILD_ROOT)/RPMS/noarch/$(PACKAGE_NAME).noarch.rpm .
srpm : clean init $(NAME).spec README.md zzz-texlive.sh zzz-texlive.csh
rpmbuild --define "_topdir $(BUILD_ROOT)" -bs $(NAME).spec
mv $(BUILD_ROOT)/SRPMS/$(PACKAGE_NAME).src.rpm .
README.md :
@echo "texlive-dummy-opensuse" > $@
@echo "======================" >> $@
@echo "" >> $@
@echo -e $(DESCRIPTION) >> $@
@echo "" >> $@
@echo "The GIT repository of the package is:" >> $@
@echo "" >> $@
@echo "https://github.com/rolfn/texlive-dummy-opensuse" >> $@
@echo "" >> $@
@cat LICENSE >> $@
@echo "" >> $@
@echo "Rolf Niepraschk, $(DATE)" >> $@
zzz-texlive.sh : zzz-texlive-tpl.sh
@cat $< | sed 's/TL_VERSION/$(YEAR)/g;s/TL_PATH/$(subst /,\/,$(TL_PATH))/g;' > $@
zzz-texlive.csh : zzz-texlive-tpl.csh
@cat $< | sed 's/TL_VERSION/$(YEAR)/g;s/TL_PATH/$(subst /,\/,$(TL_PATH))/g;' > $@
init : $(NAME).spec README.md zzz-texlive.sh zzz-texlive.csh
@mkdir -p $(addprefix $(BUILD_ROOT),BUILD BUILDROOT RPMS SOURCES SPECS SRPMS)
@cp $+ $(BUILD_ROOT)/SOURCES
clean :
@rm -rf $(BUILD_ROOT) zzz-texlive.sh zzz-texlive.csh TL_PACKAGES.lst \
README.md $(NAME).spec $(PACKAGE_NAME).noarch.rpm
TL_PACKAGES.lst :
@zypper se texlive | \
awk -F '|' '/texlive/ && !/texlive-dummy/ && !/texlive-config/ && $$2 !~ /debug/ \
{print $$2}' | uniq > $@
$(NAME).spec : TL_PACKAGES.lst
@echo "#" > $@
@echo "# spec file for package $(NAME)" >> $@
@echo "#" >> $@
@echo "Name: $(NAME)" >> $@
@echo "Summary: A "dummy-package" for TeX Live" >> $@
@echo "License: LPPL" >> $@
@echo "Group: Metapackages" >> $@
@echo "" >> $@
@echo "Version: $(VERSION)" >> $@
@echo "Release: $(RELEASE)" >> $@
@echo "Source0: README.md" >> $@
@echo "Source1: zzz-texlive.sh" >> $@
@echo "Source2: zzz-texlive.csh" >> $@
@echo "" >> $@
@echo "Provides: %{name} texlive psutils xindy xindy-doc xindy-rules" >> $@
@cat TL_PACKAGES.lst | sed 's/^\(.*\)/Provides: \1/' >> $@
@echo "Obsoletes: texlive < %{version}" >> $@
@cat TL_PACKAGES.lst | sed 's/^\(.*\)/Obsoletes: \1/' >> $@
@echo "BuildRoot: %{_tmppath}/%{name}-%{version}-build" >> $@
@echo "BuildArch: noarch" >> $@
@echo "Recommends: perl-Tk" >> $@
@echo "" >> $@
@echo "%description" >> $@
@echo $(DESCRIPTION) >> $@
@echo "" >> $@
@echo "%prep" >> $@
@echo "%setup -c -T" >> $@
@echo "cp %{SOURCE0} ." >> $@
@echo "" >> $@
@echo "%build" >> $@
@echo "#nothing to do" >> $@
@echo "" >> $@
@echo "%install" >> $@
@echo "mkdir -p %{buildroot}%{_sysconfdir}/profile.d" >> $@
@echo "install -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/profile.d/" >> $@
@echo "install -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/profile.d/" >> $@
@echo "" >> $@
@echo "%clean" >> $@
@echo "rm -rf %{buildroot}" >> $@
@echo "" >> $@
@echo "%files" >> $@
@echo "%defattr(-, root, root)" >> $@
@echo "%doc README.md" >> $@
@echo "%config %{_sysconfdir}/profile.d/zzz-texlive.sh" >> $@
@echo "%config %{_sysconfdir}/profile.d/zzz-texlive.csh" >> $@
@echo "" >> $@
@echo "%changelog" >> $@
@cat CHANGES >> $@
@echo "" >> $@
dist : all
@rm -rf openSUSE
@mkdir openSUSE
@cp -p README.md $(PACKAGE_NAME).noarch.rpm \
$(PACKAGE_NAME).src.rpm openSUSE/
zip $(NAME)-$(YEAR)-$(RELEASE).zip -r openSUSE