From: Pavel Charvat Date: Sat, 7 Dec 2013 10:06:12 +0000 (+0100) Subject: Packages: Several fixes in debian packages and their versioning. X-Git-Tag: v5.99~58 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=27279fcb63d805cc21d3c5cfa318d629ee02575a;p=libucw.git Packages: Several fixes in debian packages and their versioning. --- diff --git a/.gitignore b/.gitignore index 4643b4ce..a1562e2c 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ TAGS _* *.swp .make.log +debian-tmp diff --git a/Makefile b/Makefile index 68ea310d..24a5071b 100644 --- a/Makefile +++ b/Makefile @@ -67,6 +67,7 @@ include $(BUILDSYS)/Makebottom ifndef CONFIG_LOCAL install: all $(INSTALL_TARGETS) + /sbin/ldconfig -n $(DESTDIR)$(INSTALL_LIB_DIR) else install: @echo "Nothing to install, this is a local build." && false diff --git a/build/Maketop b/build/Maketop index 4fa79c58..39e6b0a8 100644 --- a/build/Maketop +++ b/build/Maketop @@ -74,7 +74,7 @@ clean:: dust rm -rf tests run/{bin,lib,include,.tree-stamp,doc} distclean:: clean - rm -rf obj run + rm -rf obj run debian-tmp testclean:: rm -f `find obj -name "*.test"` diff --git a/charset/Makefile b/charset/Makefile index 9b37fe68..3fb8811c 100644 --- a/charset/Makefile +++ b/charset/Makefile @@ -2,20 +2,21 @@ DIRS+=charset +LIBCHARSET_PROGS= LIBCHARSET_MODS=toupper tolower tocat toligatures unaccent charconv setnames fb-charconv stk-charconv mp-charconv LIBCHARSET_INCLUDES=charconv.h unicat.h fb-charconv.h stk-charconv.h mp-charconv.h $(o)/charset/libucw-charset.a: $(addsuffix .o,$(addprefix $(o)/charset/,$(LIBCHARSET_MODS))) $(o)/charset/libucw-charset-pic.a: $(addsuffix .oo,$(addprefix $(o)/charset/,$(LIBCHARSET_MODS))) $(o)/charset/libucw-charset.so: $(addsuffix .oo,$(addprefix $(o)/charset/,$(LIBCHARSET_MODS))) -$(o)/charset/libucw-charset.so: SONAME_SUFFIX=.$(UCW_ABI_VERSION) +$(o)/charset/libucw-charset.so: SONAME_SUFFIX=.$(UCW_ABI_MAJOR) $(o)/charset/libucw-charset.pc: $(LIBUCW) ifdef CONFIG_STATIC_PIC $(o)/charset/libucw-charset.pc: $(o)/charset/libucw-charset-pic.a endif ifdef CONFIG_INSTALL_API -$(o)/charset/libucw-charset.pc: $(o)/charset/libucw-charset.a $(o)/charset/libucw-charset-pic.a $(o)/charset/libucw-charset.so +$(o)/charset/libucw-charset.pc: $(addprefix $(o)/charset/libucw-charset,.a -pic.a .so) endif API_LIBS+=libucw-charset @@ -25,10 +26,12 @@ $(o)/charset/.include-stamp: IDST=charset run/lib/pkgconfig/libucw-charset.pc: $(o)/charset/libucw-charset.pc ifdef CONFIG_CHARSET_UTILS -PROGS+=$(o)/charset/cs2cs +LIBCHARSET_PROGS+=$(o)/charset/ucw-cs2cs endif -$(o)/charset/cs2cs: $(o)/charset/cs2cs.o $(LIBUCW) $(o)/charset/libucw-charset.pc +$(o)/charset/ucw-cs2cs: $(o)/charset/ucw-cs2cs.o $(LIBCHARSET) + +PROGS+=$(LIBCHARSET_PROGS) build_charsets: cd $(s)/charset && sh misc/generate @@ -36,11 +39,11 @@ build_charsets: clean:: rm -f $(s)/charset/misc/u-* -INSTALL_TARGETS+=install-libucw-charset install-libucw-charset-api +INSTALL_TARGETS+=install-libucw-charset install-libucw-charset-api install-libucw-charset-utils install-libucw-charset: install -d -m 755 $(DESTDIR)$(INSTALL_LIB_DIR) - install -m 644 run/lib/libucw-charset.so.$(UCW_ABI_VERSION) $(DESTDIR)$(INSTALL_LIB_DIR) + install -m 644 run/lib/libucw-charset.so.$(UCW_ABI_MAJOR) $(DESTDIR)$(INSTALL_LIB_DIR)/libucw-charset.so.$(UCW_ABI_VERSION) install-libucw-charset-api: install -d -m 755 $(DESTDIR)$(INSTALL_INCLUDE_DIR)/charset $(DESTDIR)$(INSTALL_LIB_DIR) $(DESTDIR)$(INSTALL_PKGCONFIG_DIR) @@ -50,4 +53,8 @@ install-libucw-charset-api: install -m 644 run/lib/libucw-charset.a $(DESTDIR)$(INSTALL_LIB_DIR) install -m 644 run/lib/libucw-charset-pic.a $(DESTDIR)$(INSTALL_LIB_DIR) -.PHONY: install-libucw-charset install-libucw-charset-api +install-libucw-charset-utils: + install -d -m 755 $(DESTDIR)$(INSTALL_BIN_DIR) + install -m 755 $(LIBCHARSET_PROGS) $(DESTDIR)$(INSTALL_BIN_DIR) + +.PHONY: install-libucw-charset install-libucw-charset-api install-libucw-charset-utils diff --git a/charset/cs2cs.c b/charset/cs2cs.c deleted file mode 100644 index 4f2a97bb..00000000 --- a/charset/cs2cs.c +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Simple character set convertor - * - * (c) 1998 Pavel Machek - * (c) 2003 Martin Mares - * - * This software may be freely distributed and used according to the terms - * of the GNU General Public License. - */ - -#include -#include - -#include -#include -#include - -#ifdef TEST -#define BUFSIZE 13 -#else -#define BUFSIZE 4096 -#endif - -int -main(int argc, char **argv) -{ - struct conv_context ctxt; - int ch_from, ch_to, n, flags; - char inbuf[BUFSIZE], outbuf[BUFSIZE]; - - if (argc != 3) - die("cs2cs in-charset out-charset"); - conv_init(&ctxt); - ch_from = find_charset_by_name(argv[1]); - if (ch_from < 0) - die("Unknown charset %s", argv[1]); - ch_to = find_charset_by_name(argv[2]); - if (ch_to < 0) - die("Unknown charset %s", argv[2]); - - conv_set_charset(&ctxt, ch_from, ch_to); - while ((n = read(0, inbuf, sizeof(inbuf))) > 0) - { - ctxt.source = inbuf; - ctxt.source_end = inbuf + n; - ctxt.dest = ctxt.dest_start = outbuf; - ctxt.dest_end = outbuf + sizeof(outbuf); - do - { - flags = conv_run(&ctxt); - if (flags & (CONV_SOURCE_END | CONV_DEST_END)) - { - int w = write(1, ctxt.dest_start, ctxt.dest - ctxt.dest_start); - if (w < 0) - die("write error: %m"); - ctxt.dest = outbuf; - } - } - while (! (flags & CONV_SOURCE_END)); - } - if (n < 0) - die("read error: %m"); - return 0; -} diff --git a/charset/ucw-cs2cs.c b/charset/ucw-cs2cs.c new file mode 100644 index 00000000..74e092ab --- /dev/null +++ b/charset/ucw-cs2cs.c @@ -0,0 +1,64 @@ +/* + * Simple character set convertor + * + * (c) 1998 Pavel Machek + * (c) 2003 Martin Mares + * + * This software may be freely distributed and used according to the terms + * of the GNU General Public License. + */ + +#include +#include + +#include +#include +#include + +#ifdef TEST +#define BUFSIZE 13 +#else +#define BUFSIZE 4096 +#endif + +int +main(int argc, char **argv) +{ + struct conv_context ctxt; + int ch_from, ch_to, n, flags; + char inbuf[BUFSIZE], outbuf[BUFSIZE]; + + if (argc != 3) + die("ucw-cs2cs in-charset out-charset"); + conv_init(&ctxt); + ch_from = find_charset_by_name(argv[1]); + if (ch_from < 0) + die("Unknown charset %s", argv[1]); + ch_to = find_charset_by_name(argv[2]); + if (ch_to < 0) + die("Unknown charset %s", argv[2]); + + conv_set_charset(&ctxt, ch_from, ch_to); + while ((n = read(0, inbuf, sizeof(inbuf))) > 0) + { + ctxt.source = inbuf; + ctxt.source_end = inbuf + n; + ctxt.dest = ctxt.dest_start = outbuf; + ctxt.dest_end = outbuf + sizeof(outbuf); + do + { + flags = conv_run(&ctxt); + if (flags & (CONV_SOURCE_END | CONV_DEST_END)) + { + int w = write(1, ctxt.dest_start, ctxt.dest - ctxt.dest_start); + if (w < 0) + die("write error: %m"); + ctxt.dest = outbuf; + } + } + while (! (flags & CONV_SOURCE_END)); + } + if (n < 0) + die("read error: %m"); + return 0; +} diff --git a/debian/config b/debian/config index d84eb825..28e05825 100644 --- a/debian/config +++ b/debian/config @@ -7,6 +7,7 @@ Set("CONFIG_INSTALL_API"); Set("CONFIG_DOC"); Set("CONFIG_CHARSET"); +Set("CONFIG_CHARSET_UTILS"); Set("CONFIG_XML"); Set("CONFIG_IMAGES"); UnSet("CONFIG_IMAGES_LIBUNGIF"); diff --git a/debian/control.in b/debian/control.in index 676bc246..e4d1a14c 100644 --- a/debian/control.in +++ b/debian/control.in @@ -4,7 +4,7 @@ Maintainer: LibUCW developers Build-Depends: debhelper (>= 7), devscripts, bash, pkg-config, libjpeg-dev, libpng-dev, libgif-dev, asciidoc Standards-Version: 3.8.0 -Package: libucw-@UCW_ABI_VERSION@ +Package: libucw-@UCW_ABI_MAJOR@ Section: libs Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} @@ -13,7 +13,7 @@ Description: LibUCW library Package: libucw-dev Section: libdevel Architecture: any -Depends: libucw-@UCW_ABI_VERSION@ (= @VER@), ${shlibs:Depends}, ${misc:Depends} +Depends: libucw-@UCW_ABI_MAJOR@ (= @VER@), ${shlibs:Depends}, ${misc:Depends} Description: LibUCW development files Package: libucw-utils diff --git a/debian/rules b/debian/rules index e4a2bad4..aedf7698 100755 --- a/debian/rules +++ b/debian/rules @@ -27,9 +27,9 @@ install: build dh_testroot dh_clean -k dh_installdirs - $(MAKE) DESTDIR=$(CURDIR)/debian/libucw-$(UCW_ABI_VERSION) $(addprefix install-,libucw libucw-charset libucw-xml libucw-images) + $(MAKE) DESTDIR=$(CURDIR)/debian/libucw-$(UCW_ABI_MAJOR) $(addprefix install-,libucw libucw-charset libucw-xml libucw-images) $(MAKE) DESTDIR=$(CURDIR)/debian/libucw-dev $(addprefix install-,$(addsuffix -api,libucw libucw-charset libucw-xml libucw-images)) - $(MAKE) DESTDIR=$(CURDIR)/debian/libucw-utils install-ucw-utils install-ucw-shell install-libucw-images-utils + $(MAKE) DESTDIR=$(CURDIR)/debian/libucw-utils install-ucw-utils install-ucw-shell install-libucw-charset-utils install-libucw-images-utils $(MAKE) DESTDIR=$(CURDIR)/debian/libucw-doc install-libucw-docs binary-indep: build install diff --git a/images/Makefile b/images/Makefile index f475127e..2a43373e 100644 --- a/images/Makefile +++ b/images/Makefile @@ -15,12 +15,12 @@ else LIBIMAGES_DEPS=$(LIBUCW) endif -ifdef CONFIG_INSTALL_API -$(o)/images/libucw-images.pc: $(o)/images/libucw-images.a $(o)/images/libucw-images-pic.a $(o)/images/libucw-images.so -endif ifdef CONFIG_STATIC_PIC LIBIMAGES_DEPS+=$(o)/images/libucw-images-pic.a endif +ifdef CONFIG_INSTALL_API +$(o)/images/libucw-images.pc: $(addprefix $(o)/images/libucw-images,.a -pic.a .so) +endif ifdef CONFIG_IMAGES_DUP LIBIMAGES_PROGS+=$(o)/images/ucw-image-dup-test @@ -70,7 +70,7 @@ CONFIGS+=$(LIBIMAGES_CONFIGS) $(o)/images/libucw-images.a: $(addsuffix .o,$(addprefix $(o)/images/,$(LIBIMAGES_MODS))) $(o)/images/libucw-images-pic.a: $(addsuffix .oo,$(addprefix $(o)/images/,$(LIBIMAGES_MODS))) $(o)/images/libucw-images.so: $(addsuffix .oo,$(addprefix $(o)/images/,$(LIBIMAGES_MODS))) -$(o)/images/libucw-images.so: SONAME_SUFFIX=.$(UCW_ABI_VERSION) +$(o)/images/libucw-images.so: SONAME_SUFFIX=.$(UCW_ABI_MAJOR) $(o)/images/libucw-images.pc: $(LIBIMAGES_DEPS) $(o)/images/ucw-image-tool: $(o)/images/ucw-image-tool.o $(LIBIMAGES) @@ -96,10 +96,10 @@ INSTALL_TARGETS+=install-libucw-images install-libucw-images-api install-libucw- install-libucw-images: install -d -m 755 $(DESTDIR)$(INSTALL_LIB_DIR) - install -m 644 run/lib/libucw-images.so.$(UCW_ABI_VERSION) $(DESTDIR)$(INSTALL_LIB_DIR) + install -m 644 run/lib/libucw-images.so.$(UCW_ABI_MAJOR) $(DESTDIR)$(INSTALL_LIB_DIR)/libucw-images.so.$(UCW_ABI_VERSION) install-libucw-images-api: - install -d -m 755 $(addprefix $(DESTDIR),$(INSTALL_BIN_DIR) $(INSTALL_INCLUDE_DIR)/images $(INSTALL_LIB_DIR) $(INSTALL_PKGCONFIG_DIR)) + install -d -m 755 $(addprefix $(DESTDIR),$(INSTALL_INCLUDE_DIR)/images $(INSTALL_LIB_DIR) $(INSTALL_PKGCONFIG_DIR)) install -m 644 $(addprefix run/include/images/,$(LIBIMAGES_INCLUDES)) $(DESTDIR)$(INSTALL_INCLUDE_DIR)/images install -m 644 run/lib/pkgconfig/libucw-images.pc $(DESTDIR)$(INSTALL_PKGCONFIG_DIR) ln -sf libucw-images.so.$(UCW_ABI_VERSION) $(DESTDIR)$(INSTALL_LIB_DIR)/libucw-images.so diff --git a/ucw/Makefile b/ucw/Makefile index 2cd12eb7..873f06e1 100644 --- a/ucw/Makefile +++ b/ucw/Makefile @@ -89,13 +89,13 @@ LIBUCW_MOD_PATHS=$(addprefix $(o)/ucw/,$(LIBUCW_MODS)) $(o)/ucw/libucw.a: $(addsuffix .o,$(LIBUCW_MOD_PATHS)) $(o)/ucw/libucw-pic.a: $(addsuffix .oo,$(LIBUCW_MOD_PATHS)) $(o)/ucw/libucw.so: $(addsuffix .oo,$(LIBUCW_MOD_PATHS)) -$(o)/ucw/libucw.so: SONAME_SUFFIX=.$(UCW_ABI_VERSION) +$(o)/ucw/libucw.so: SONAME_SUFFIX=.$(UCW_ABI_MAJOR) ifdef CONFIG_STATIC_PIC $(o)/ucw/libucw.pc: $(o)/ucw/libucw-pic.a endif ifdef CONFIG_INSTALL_API -$(o)/ucw/libucw.pc: $(o)/ucw/libucw.a $(o)/ucw/libucw-pic.a $(o)/ucw/libucw.so +$(o)/ucw/libucw.pc: $(addprefix $(o)/ucw/libucw,.a -pic.a .so) endif $(o)/ucw/hashfunc.o $(o)/ucw/hashfunc.oo: CFLAGS += -funroll-loops @@ -188,7 +188,7 @@ INSTALL_TARGETS+=install-libucw install-libucw-api install-libucw: install -d -m 755 $(DESTDIR)$(INSTALL_LIB_DIR) - install -m 644 run/lib/libucw.so.$(UCW_ABI_VERSION) $(DESTDIR)$(INSTALL_LIB_DIR)/ + install -m 644 run/lib/libucw.so.$(UCW_ABI_MAJOR) $(DESTDIR)$(INSTALL_LIB_DIR)/libucw.so.$(UCW_ABI_VERSION) install-libucw-api: install -d -m 755 $(DESTDIR)$(INSTALL_LIB_DIR) $(DESTDIR)$(INSTALL_INCLUDE_DIR)/ucw/ $(DESTDIR)$(INSTALL_PKGCONFIG_DIR) diff --git a/ucw/default.cfg b/ucw/default.cfg index ec8feabb..0b643184 100644 --- a/ucw/default.cfg +++ b/ucw/default.cfg @@ -4,7 +4,7 @@ # Version of the whole package Set("UCW_VERSION" => "5.0-dev"); Set("UCW_VERSION_CODE" => 5000000); -Set("UCW_ABI_VERSION" => "5.0"); +Set("UCW_ABI_VERSION" => Get("UCW_VERSION_CODE") . ".0"); # Compile everything with debug information and ASSERT's UnSet("CONFIG_DEBUG"); diff --git a/ucw/perl/UCW/Configure/LibUCW.pm b/ucw/perl/UCW/Configure/LibUCW.pm index 7feef1e2..cdfde1d7 100644 --- a/ucw/perl/UCW/Configure/LibUCW.pm +++ b/ucw/perl/UCW/Configure/LibUCW.pm @@ -89,6 +89,13 @@ if (IsSet("CONFIG_DARWIN")) { } } +if (Get("UCW_ABI_VERSION") =~ /^(\d+)\.\d+(\.\d+)?$/) { + Set("UCW_ABI_MAJOR", $1); +} +else { + Fail("Invalid syntax of UCW_ABI_VERSION"); +} + PostConfig { AtWrite { UCW::Configure::C::ConfigHeader("ucw/autoconf.h", [ diff --git a/xml/Makefile b/xml/Makefile index 4a1b2e6b..bf1a8096 100644 --- a/xml/Makefile +++ b/xml/Makefile @@ -12,14 +12,14 @@ LIBXML_MOD_PATHS=$(addprefix $(o)/xml/,$(LIBXML_MODS)) $(o)/xml/libucw-xml.a: $(addsuffix .o,$(LIBXML_MOD_PATHS)) $(o)/xml/libucw-xml-pic.a: $(addsuffix .oo,$(LIBXML_MOD_PATHS)) $(o)/xml/libucw-xml.so: $(addsuffix .oo,$(LIBXML_MOD_PATHS)) -$(o)/xml/libucw-xml.so: SONAME_SUFFIX=.$(UCW_ABI_VERSION) +$(o)/xml/libucw-xml.so: SONAME_SUFFIX=.$(UCW_ABI_MAJOR) $(o)/xml/libucw-xml.pc: $(LIBCHARSET) ifdef CONFIG_STATIC_PIC $(o)/xml/libucw-xml.pc: $(o)/xml/libucw-xml-pic.a endif ifdef CONFIG_INSTALL_API -$(o)/xml/libucw-xml.pc: $(o)/xml/libucw-xml.a $(o)/xml/libucw-xml-pic.a $(o)/xml/libucw-xml.so +$(o)/xml/libucw-xml.pc: $(addprefix $(o)/xml/libucw-xml,.a -pic.a .so) endif $(o)/xml/common.o: $(o)/xml/unicat.h @@ -49,7 +49,7 @@ INSTALL_TARGETS+=install-libucw-xml install-libucw-xml-api install-libucw-xml: install -d -m 755 $(DESTDIR)$(INSTALL_LIB_DIR) - install -m 644 run/lib/libucw-xml.so.$(UCW_ABI_VERSION) $(DESTDIR)$(INSTALL_LIB_DIR) + install -m 644 run/lib/libucw-xml.so.$(UCW_ABI_MAJOR) $(DESTDIR)$(INSTALL_LIB_DIR)/libucw-xml.so.$(UCW_ABI_VERSION) install-libucw-xml-api: install -d -m 755 $(DESTDIR)$(INSTALL_INCLUDE_DIR)/xml $(DESTDIR)$(INSTALL_LIB_DIR) $(DESTDIR)$(INSTALL_PKGCONFIG_DIR)