Wednesday, December 26, 2007

How to create a debian package from a Icon set ?

Using a nice changed rules file you can make debian packages a bit easy :


so lets work with that script :

#!/usr/bin/make -f
#
#
# This Rules script had been created by Boris Shtrasman and is released under the GPLv3 licence
# to use it you should :
# 1. download your favorite icon set.
# 2. create a directory : kde-icon-"iconpackname"-"version"
# 3. Using dh_make create a debian package :
# dh_make --f sourcefile from the directory with the name kde-icon-whatever-version
# 4. Edit control + changelog + dirs +copyrights
# 5. copy this file inside debian/ directory.
# 6. change the `package=kde-icons-nuovext` string to
# `package=kde-icon-"iconpackname"-"version" `
# 7. run dpkg-rfakeroot
# 8. post yout package some where on the net
#
#


package=kde-icons-nuovext

#let collect some info :
#
#
# First let get the name i fought using :
# tar -tf `ls *.tar.gz` | `awk '{print $1}'` but then it is really long operation ..


dir=`ls $(CURDIR)/debian/$(package)/usr/share/icons`
createdDirectory=$(CURDIR)/debian/$(package)/usr/share/icons/$(dir)/

build:

clean:
dh_testdir
dh_testroot
dh_clean

binary-indep:
dh_clean
dh_testdir
dh_testroot
dh_installdirs /usr/share/icons
dh_installchangelogs
dh_installdocs

tar -C $(CURDIR)/debian/$(package)/usr/share/icons -zxf `ls $(CURDIR)/*.tar.gz `


mv $(createdDirectory)README \
$(CURDIR)/debian/$(package)/usr/share/doc/$(package)/README
mv $(CURDIR)/debian/$(package)/usr/share/icons/nuoveXT-2.2/AUTHORS \
$(CURDIR)/debian/$(package)/usr/share/doc/$(package)/AUTHORS
# mv $(createdDirectory)DONATE \

mv $(createdDirectory)DONATE \
$(CURDIR)/debian/$(package)/usr/share/doc/$(package)/DONATE
# No need for licence * 2 and install guides ..
rm -f $(createdDirectory)license
rm -f $(createdDirectory)COPYING
rm -f $(createdDirectory)INSTALL
# end of licencing part

@echo
@echo
@echo Do i nees macos ds file ? i guess not ..
@echo
find ./debian/kde-icons-nuovext/ -name \.DS* -exec rm '{}' \;
# end of DS file part ..
@echo
@echo Let set all files as -rwxr--r--
@echo
find $(CURDIR)/debian/$(package) -type f -exec chmod 644 {} \;
@echo
@echo And dirs as drwxrw-rw-rw-
find $(CURDIR)/debian/$(package) -type d -exec chmod 755 {} \;
@echo
@echo Recompressing icons...
find $(CURDIR)/debian/$(package) -name \*.png \
-exec /usr/bin/convert {} -quality 100 {} \;
dh_fixperms
dh_compress
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb

binary-arch:

binary: binary-indep binary-arch

.PHONY: binary binary-arch binary-indep clean build

and here is the ->reault <- (ready to install deb package) and you can get the source for this dir from mentors


0 comments: