Skip to content

Commit 4cd2287

Browse files
committed
Add packaging for FreeDOS
1 parent a2fa894 commit 4cd2287

File tree

10 files changed

+970
-1
lines changed

10 files changed

+970
-1
lines changed

cabextract/dos/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
fdpackage/
12
objects/
23
products/
34
tests/

cabextract/dos/Makefile

Lines changed: 90 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
# These directories should be in the .gitignore file.
1212
# Note that wmake intercepts `mkdir` and `rm`.
1313
OBJECT_DIR = objects
14+
PACKAGE_DIR = fdpackage
1415
PRODUCT_DIR = products
1516
TEST_DIR = tests
1617

@@ -84,6 +85,36 @@ DOSBOX = flatpak run com.dosbox_x.DOSBox-X
8485
DOSOPT = -exit -fastlaunch -nolog
8586
DOSCNF = tests.in/dosbox.cnf
8687

88+
# Generates $(VERSION_SH) from the git log.
89+
GIT_FORMAT = "format:COMMIT_HASH='%h'%nCOMMIT_AUTHOR_EMAIL='%ae'%nCOMMIT_AUTHOR_NAME='%an'%nMAINTAINED_BY='%ae (%an)'%n"
90+
91+
# The patch series put in the $(PATCHES_ZIP) file.
92+
GIT_RANGE = upstream..HEAD
93+
94+
# Most apps in FreeDOS distribution are packed by UPX.
95+
UPX = upx
96+
UPXOPT = --ultra-brute -qq
97+
UPXTARGETS = $(PACKAGE_DIR)/BIN/CABEXT.EXE $(PACKAGE_DIR)/BIN/CABINFO.EXE
98+
99+
# The AdvanceCOMP implementation of zip.
100+
ZIP = advzip
101+
102+
# `-a2` is libdeflate, which does 5% better than InfoZIP.
103+
# `-a4i1024` is 1k iterations of zopfli, which does 1% better than libdeflate.
104+
ZIP_DEFLATE = $(ZIP) -a2
105+
106+
# Store the source package, which makes it solid in the binary package.
107+
ZIP_STORE = $(ZIP) -a0
108+
109+
# InfoZIP equivalents.
110+
#ZIP = zip
111+
#ZIP_DEFLATE = $(ZIP) -9 --no-extra --recurse-paths --dos-names
112+
#ZIP_STORE = $(ZIP) -0 --no-extra --recurse-paths
113+
114+
# Source code for the FreeDOS package.
115+
PATCHES_ZIP = $(PACKAGE_DIR)/SOURCE/CABEXT/PATCHES.ZIP
116+
SOURCES_ZIP = $(PACKAGE_DIR)/SOURCE/CABEXT/SOURCES.ZIP
117+
87118
# The default rule.
88119
all: .SYMBOLIC $(TARGETS)
89120
@%null
@@ -113,6 +144,10 @@ $(OBJECT_DIR):
113144
mkdir -p $@/mspack
114145
mkdir -p $@/src
115146

147+
$(PACKAGE_DIR): fdpackage.in
148+
cp -r $< $@
149+
mkdir -p $@/BIN
150+
116151
$(PRODUCT_DIR):
117152
mkdir -p $@
118153

@@ -126,7 +161,7 @@ $(VERSION_SH): ../configure.ac $(OBJECT_DIR)
126161
-e '/AC_INIT/{ print "VERSION=" $$4; exit; }' &
127162
../configure.ac; &
128163
if test -d ../../.git && which -s git; then &
129-
echo COMMIT_HASH=`git rev-parse --short HEAD`; &
164+
git log -1 --pretty=$(GIT_FORMAT); &
130165
fi; &
131166
) >$@
132167
@$(MADE) $@
@@ -169,8 +204,19 @@ $(PRODUCT_DIR)/CABINFO.EXE: $(PRODUCT_DIR) $(VERSION_H) $(CABINFO_OBJ)
169204
$(LD) $(LFLAGS) name $@ file { $(CABINFO_OBJ) } | $(LD_SQUELCH)
170205
@$(MADE) $@
171206

207+
$(PACKAGE_DIR)/BIN/CABEXT.EXE: $(PRODUCT_DIR)/CABEXT.EXE
208+
rm -f $@
209+
$(UPX) $(UPXOPT) -o $@ $<
210+
@$(MADE) $@
211+
212+
$(PACKAGE_DIR)/BIN/CABINFO.EXE: $(PRODUCT_DIR)/CABINFO.EXE
213+
rm -f $@
214+
$(UPX) $(UPXOPT) -o $@ $<
215+
@$(MADE) $@
216+
172217
clean: .SYMBOLIC
173218
rm -fr $(OBJECT_DIR)
219+
rm -fr $(PACKAGE_DIR)
174220
rm -fr $(PRODUCT_DIR)
175221
rm -fr $(TEST_DIR)
176222

@@ -187,3 +233,46 @@ $(TEST_DIR)/report.txt: .PRECIOUS $(TEST_DIR) $(DOSCNF) $(TARGETS)
187233

188234
test: .SYMBOLIC $(TEST_DIR)/report.txt
189235
@%null
236+
237+
$(SOURCES_ZIP): $(PACKAGE_DIR)
238+
@($(SHOPT) &
239+
cd ../..; &
240+
git archive HEAD --format=zip -0; &
241+
) >$@
242+
@$(MADE) $@
243+
244+
$(PATCHES_ZIP): $(PACKAGE_DIR)
245+
@($(SHOPT) &
246+
cd $^:; &
247+
git format-patch $(GIT_RANGE); &
248+
if ls *.patch 1>/dev/null 2>&1; &
249+
then &
250+
$(ZIP_STORE) $^. *.patch; &
251+
rm *.patch; &
252+
else &
253+
:>$^.; &
254+
fi; &
255+
)
256+
@$(MADE) $@
257+
258+
package: .SYMBOLIC $(PACKAGE_DIR) $(PATCHES_ZIP) $(SOURCES_ZIP) $(UPXTARGETS) $(VERSION_SH)
259+
cp ../AUTHORS $(PACKAGE_DIR)/DOC/CABEXT/AUTHORS.TXT
260+
cp ../ChangeLog $(PACKAGE_DIR)/DOC/CABEXT/CHANGES.TXT
261+
cp ../README $(PACKAGE_DIR)/DOC/CABEXT/README.TXT
262+
cp ../NEWS $(PACKAGE_DIR)/DOC/CABEXT/NEWS.TXT
263+
cp ../TODO $(PACKAGE_DIR)/DOC/CABEXT/TODO.TXT
264+
unix2dos $(PACKAGE_DIR)/DOC/CABEXT/*.TXT &
265+
$(PACKAGE_DIR)/APPINFO/*
266+
@($(SHOPT) &
267+
. $(VERSION_SH); &
268+
PRODUCT_DIR="`pwd`/$(PRODUCT_DIR)"; &
269+
PACKAGE_OUT="cabextract-$$VERSION+$$COMMIT_HASH.dos.zip"; &
270+
cd "$(PACKAGE_DIR)"; &
271+
sed -e "s/Maintained-by:.*/Maintained-by: $$MAINTAINED_BY\r/" &
272+
-e "s/Modified-date:.*/Modified-date: `date --iso-8601`\r/" &
273+
-e "s/Version:.*/Version: $$VERSION\r/" &
274+
-i APPINFO/CABEXT.LSM; &
275+
$(ZIP_DEFLATE) "$$PRODUCT_DIR/$$PACKAGE_OUT" *; &
276+
cd -; &
277+
$(MADE) $(PRODUCT_DIR)/$$PACKAGE_OUT &
278+
)
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Begin3
2+
Language: DE, 850, German (Standard)
3+
Title: cabextract
4+
Description: Entpacker f�r CAB-Dateien.
5+
Summary: cabextract entpackt eine Anzahl verschiedener Microsoft CAB Formate.
6+
Keywords: cab, komprimiert, entpacken, Archiv
7+
End
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Begin3
2+
Language: FR, 850, French (Standard)
3+
Title: cabextract
4+
Description: Extraire des fichiers de divers formats CAB
5+
Summary: cabextract peut extraire des fichiers de divers formats Microsoft CAB.
6+
Keywords: cab, compress�, archive
7+
End
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Begin3
2+
Title: cabextract
3+
Version: %VERSION%
4+
Entered-date: 2018-10-30
5+
Description: CAB file extractor
6+
Keywords: archive, cabinet, cabinfo, decompress, extract
7+
Author: kyzer@cabextract.org.uk (Stuart Caie)
8+
Maintained-by: %COMMIT_AUTHOR_EMAIL% (%COMMIT_AUTHOR_NAME%)
9+
Original-site: https://www.cabextract.org.uk/
10+
Primary-site: https://github.com/dajhorn/libmspack/
11+
Platforms: DOS
12+
Copying-policy: GNU General Public License, Version 3
13+
Modified-date: %MODIFIED_DATE%
14+
Summary: Unpacks all Microsoft cabinet formats (single, combined, and split) and decompresses all Microsoft cabinet codecs (quantum, msz, and lzx).
15+
End
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Begin3
2+
Language: SV, 850, Swedish
3+
Title: cabextract
4+
Description: cabextract kan extrahera filer fr†n en m„ngd olika Microsoft CAB-format.
5+
Keywords: cab, komprimerat, arkiv
6+
End
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Begin3
2+
Language: TR, 857, Turkish
3+
Title: cabextract
4+
Description: �e�itli CAB bi�imlerinden dosya ��kar
5+
Summary: cabextract, �e�itli Microsoft CAB bi�imlerinden dosya ��karabilir.
6+
Keywords: cab, s�k��t�r�lm��, ar�iv
7+
End

0 commit comments

Comments
 (0)