Commit e4001085 authored by Oskar Skog's avatar Oskar Skog

Pre 0.2.23: Make dist should now work on both BSD make and GNU make

parent e29f3ee4
__pycache__
*.tar.gz
*.tar.xz
*.zip
*.pyc
*~
......
2016-08-07 Oskar Skog <[email protected]>
0.2.23
*: New file: HACKING
* Makefile.static: $$ doesn't work on FreeBSD's make, it needs to be
$$$$ which doesn't work on gmake. Created small shellscripts to
be invoked from make.
2016-07-19 Oskar Skog <[email protected]>
0.2.22
* anonymine_engine.py (hiscores (display)): Www HH:MM goes back to
......
......@@ -12,7 +12,7 @@
NAME := anonymine
NAME_C := Anonymine
DESCRIPTION = Minesweeper without guessing
VERSION := 0.2.22
VERSION := 0.2.23
# Five more variables are required: sysconfdir, vargamesdir, EXECUTABLES and
# MODULES, and MODULES_OTHERVER which may be set to "non-existent".
......@@ -316,67 +316,26 @@ print-destinations: FORCE
echo "[Windows] Icon: " $(CYG_ICO_DEST); \
fi
PKG_INDIR := $(NAME)-$(VERSION)
PKG := $(builddir)$(PKG_INDIR)
# .txt in zips.
PKG_TEXTFILES := BUGS ChangeLog FAQ INSTALL NEWS README desktop/FILES \
desktop/README LICENSE
# Already CRLF + old crap.
PKG_NOCONV := Windows.txt Windows-admin.bat Windows-user.bat \
configure check.sh desktop/$(NAME).ico desktop/desktop.sh \
desktop/$(NAME)-*.png desktop/$(NAME)*.xcf mkenginecfg
PKG_FILES := $(NAME).py $(NAME)_engine.py $(NAME)_fields.py $(NAME)_solver.py \
configure.py Makefile.static install-cfg enginecfg.default \
cursescfg test.py desktop/Info.plist.py desktop/icon.icns.py
PKG_SUBDIRS := desktop
check: FORCE
@$(srcdir)check.sh "$(srcdir)" "$(builddir)"
dist : tarballs zip
@$(info) 'make check; This will take a while'
@make check >/dev/null
@$(info) 'make release'
@make release >/dev/null
dist : tarballs zip check
@true
release : FORCE
release : dist
@cp -t ~www-data/archive/"$(NAME)/" "$(PKG).tar.gz" \
|| echo You are not me.
@cp -t ~www-data/archive/"$(NAME)/" "$(PKG).tar.xz" \
|| echo You are not me.
@cp -t ~www-data/archive/"$(NAME)/" "$(PKG).zip" \
|| echo You are not me.
PKG := $(NAME)-$(VERSION)
tarballs : FORCE
@$(info) "Building tarballs"
@mkdir "$(PKG)"
@for subdir in $(PKG_SUBDIRS); do mkdir "$(PKG)/$$subdir"; done;
@: # Copy all files normally:
@for f in $(PKG_TEXTFILES); do cp "$(srcdir)$$f" "$(PKG)/$$f"; done
@for f in $(PKG_NOCONV); do cp "$(srcdir)$$f" "$(PKG)/$$f"; done
@for f in $(PKG_FILES); do cp "$(srcdir)$$f" "$(PKG)/$$f"; done
@: # Tar:
@cd "$(builddir)" && tar -cf "$(PKG_INDIR).tar" "$(PKG_INDIR)"
@: # Compress:
@gzip -f9k -- "$(PKG).tar"
@: # Clean-up:
@rm -- "$(PKG).tar"
@rm -r -- "$(PKG)"
@$(srcdir)dist "$(srcdir)" "$(builddir)" "$(PKG)" tar
zip : FORCE
@$(info) "Building zip for Windows version"
@mkdir "$(PKG)"
@for subdir in $(PKG_SUBDIRS); do mkdir "$(PKG)/$$subdir"; done;
@: # /(.*)$/ -> /\1.txt/
@for f in $(PKG_TEXTFILES); do \
unix2dos -q -n "$(srcdir)$$f" "$(PKG)/$$f.txt"; \
done
@: # Already with CRLF line ends + shell scripts.
@for f in $(PKG_NOCONV); do cp "$(srcdir)$$f" "$(PKG)/$$f"; done
@: # Notepad is stupid.
@for f in $(PKG_FILES); \
do unix2dos -q -n "$(srcdir)$$f" "$(PKG)/$$f"; \
done
@cd "$(builddir)" && zip -rXq "$(PKG_INDIR).zip" "$(PKG_INDIR)"
@rm -r -- "$(PKG)"
@$(srcdir)dist "$(srcdir)" "$(builddir)" "$(PKG)" zip
FORCE:
#!/bin/sh
# Usage: ./dist srcdir builddir pkgname {zip|tar}
srcdir=$1
builddir=$2
pkgname=$3
type=$4
pkgdir=$builddir$pkgname
NAME="anonymine"
# Add .txt for Windows.
textfiles="BUGS ChangeLog FAQ INSTALL NEWS README LICENSE desktop/FILES \
desktop/README"
# Already CRLF + shell scripts
noconv="Windows.txt Windows-admin.bat Windows-user.bat configure check.sh \
desktop/${NAME}.ico desktop/desktop.sh desktop/${NAME}-*.png \
desktop/${NAME}*.xcf mkenginecfg dist"
# LF to CRLF conversion for the zip
files="${NAME}.py ${NAME}_engine.py ${NAME}_fields.py ${NAME}_solver.py \
configure.py Makefile.static install-cfg enginecfg.default cursescfg \
test.py desktop/Info.plist.py desktop/icon.icns.py"
subdirs="desktop"
mkdir $pkgdir
for subdir in $subdirs; do
mkdir "$pkgdir/$subdir"
done
if [ $type = "tar" ] || [ -z "`which unix2dos`" ]; then
for f in $textfiles $noconv $files; do
cp "$srcdir$f" "$pkgdir/$f"
done
cd $builddir
tar -cf "$pkgname.tar" "$pkgname"
gzip -9 -k "$pkgname.tar" || echo no gzip
xz -9e -k "$pkgname.tar" || echo no xz
rm "$pkgdir.tar"
fi
if [ $type = "zip" ] && [ -n "`which unix2dos`" ]; then
for f in $textfiles; do
unix2dos -q -n "$srcdir$f" "$pkgdir/$f.txt"
done
for f in $files; do
unix2dos -q -n "$srcdir$f" "$pkgdir/$f"
done
for f in $noconv; do
cp "$srcdir$f" "$pkgdir/$f"
done
cd $builddir
zip -rXq "$pkgname.zip" "$pkgname"
rm "$pkgdir.zip"
fi
rm -r "$pkgdir"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment