Browse Source

replace with an ImageMagick based script

master
parent
commit
bba150dfd9
  1. 21
      png2ico/png2ico.patch
  2. 30
      png2ico/png2ico.sh
  3. 46
      png2ico/png2ico.spec

21
png2ico/png2ico.patch

@ -1,21 +0,0 @@
Index: Makefile
--- Makefile.orig 2002-12-07 23:49:52 +0100
+++ Makefile 2006-04-03 20:34:11 +0200
@@ -1,11 +1,13 @@
-CPPFLAGS=-W -Wall -O2 -finline-functions
-#CPPFLAGS=-O0 -W -Wall
-DEBUG=-g
+CC = g++
+CFLAGS = -Wall
+CPPFLAGS =
+LDFLAGS =
+LIBS = -lpng -lz -lm
all: png2ico
png2ico: png2ico.cpp
- g++ $(CPPFLAGS) $(DEBUG) -o $@ $< -lpng -lz -lm
+ $(CC) $(CFLAGS) $(CPPFLAGS) -o $@ $< $(LDFLAGS) $(LIBS)
doc/png2ico.txt: doc/png2ico.1
man $< |sed -e $$'s/.\b\\(.\\)/\\1/g' -e 's/\(.*\)/\1'$$'\r/' >$@

30
png2ico/png2ico.sh

@ -0,0 +1,30 @@
#!/bin/sh
##
## png2ico.sh -- PNG to ICO(N) format conversion with ImageMagick
## Copyright (c) 2014 Ralf S. Engelschall <rse@engelschall.com>
##
## See Also:
## - http://en.wikipedia.org/wiki/ICO_%28file_format%29
## - http://en.wikipedia.org/wiki/Favicon
##
# sanity check usage
if [ $# -ne 2 ]; then
echo "USAGE: png2ico <name>.{png|gif|...} <name>.ico" 1>&2
exit 1
fi
# run ImageMagick to perform the conversion
exec @l_prefix@/bin/convert \
"$1" \
-background transparent \
-bordercolor transparent \
-border 0 \
-colors 256 \
\( -clone 0 -resize x16 -gravity center -crop 16x16+0+0\! -flatten \) \
\( -clone 0 -resize x32 -gravity center -crop 32x32+0+0\! -flatten \) \
\( -clone 0 -resize x48 -gravity center -crop 48x48+0+0\! -flatten \) \
\( -clone 0 -resize x64 -gravity center -crop 64x64+0+0\! -flatten \) \
-delete 0 \
"$2"

46
png2ico/png2ico.spec

@ -21,64 +21,44 @@
## SUCH DAMAGE. ## SUCH DAMAGE.
## ##
# package version
%define V_opkg 20021208
%define V_dist 2002-12-08
# package information # package information
Name: png2ico Name: png2ico
Summary: PNG to ICON Converter Summary: PNG to ICON Converter
URL: http://www.winterdrache.de/freeware/png2ico/ URL: http://www.openpkg.org/
Vendor: Matthias Benkmann Vendor: OpenPKG Foundation e.V.
Packager: OpenPKG Foundation e.V. Packager: OpenPKG Foundation e.V.
Distribution: OpenPKG Community Distribution: OpenPKG Community
Class: EVAL Class: EVAL
Group: Graphics Group: Graphics
License: GPL License: PD
Version: %{V_opkg} Version: 20140209
Release: 20080101 Release: 20140209
# list of sources # list of sources
Source0: http://www.winterdrache.de/freeware/png2ico/data/png2ico-src-%{V_dist}.tar.gz Source0: png2ico.sh
Patch0: png2ico.patch
# build information # build information
BuildPreReq: OpenPKG, openpkg >= 20100101, gcc, make BuildPreReq: OpenPKG, openpkg >= 20100101
PreReq: OpenPKG, openpkg >= 20100101 PreReq: OpenPKG, openpkg >= 20100101
BuildPreReq: png, zlib
PreReq: png, zlib
%description %description
png2ico converts PNG image files to Windows ICON resource files, png2ico converts PNG image files to Windows ICO(N) resource files,
i.e., files containing icon images in various resolutions and i.e., files containing icon images in various resolutions and
usually with binary transparency. usually with binary transparency.
%track %track
prog png2ico = {
version = %{V_dist}
url = http://www.winterdrache.de/freeware/png2ico/
regex = png2ico-src-(__VER__)\.tar\.gz
}
%prep %prep
%setup -q -n png2ico %setup -q -T -c
%patch -p0
%build %build
%{l_make} %{l_mflags} \
CC="%{l_cxx}" \
CFLAGS="%{l_cflags -O}" \
CPPFLAGS="%{l_cppflags}" \
LDFLAGS="%{l_ldflags}"
%install %install
%{l_shtool} mkdir -f -p -m 755 \ %{l_shtool} mkdir -f -p -m 755 \
$RPM_BUILD_ROOT%{l_prefix}/bin \ $RPM_BUILD_ROOT%{l_prefix}/bin
$RPM_BUILD_ROOT%{l_prefix}/man/man1 %{l_shtool} install -c -m 755 %{l_value -s -a} \
%{l_shtool} install -c -s -m 755 \ %{SOURCE png2ico.sh} \
png2ico $RPM_BUILD_ROOT%{l_prefix}/bin/ $RPM_BUILD_ROOT%{l_prefix}/bin/png2ico
%{l_shtool} install -c -m 644 \
doc/png2ico.1 $RPM_BUILD_ROOT%{l_prefix}/man/man1/
%{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
%files -f files %files -f files

Loading…
Cancel
Save