From 35a9c1e1af111264a29f2b65b229ab36e881b0e5 Mon Sep 17 00:00:00 2001 From: Alexander Trufanov Date: Wed, 17 Mar 2021 11:08:59 +0300 Subject: [PATCH] Add builddeb rules to make the deb packages --- CMakeLists.txt | 76 +++++++++++++++++++++++--------------------- debian/changelog | 5 +++ debian/control | 16 ++++++++++ debian/copyright | 7 ++++ debian/rules | 9 ++++++ debian/source/format | 1 + src/c44-fi.cpp | 2 +- 7 files changed, 78 insertions(+), 38 deletions(-) create mode 100644 debian/changelog create mode 100644 debian/control create mode 100644 debian/copyright create mode 100755 debian/rules create mode 100644 debian/source/format diff --git a/CMakeLists.txt b/CMakeLists.txt index 4fe9619..6a7b23a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,6 +16,8 @@ SET( PROJECT("FreeImage version of c44 encoder") +SET(CMAKE_BUILD_TYPE "Release") # builddeb won't compile with "None" + # should point to DjVuLibre sources SET(djvu_libre_sources_path "./djvulibre/") SET(libdjvu "${djvu_libre_sources_path}libdjvu/" ) @@ -34,18 +36,18 @@ IF(CMAKE_COMPILER_IS_GNUCC) ENDIF(CMAKE_COMPILER_IS_GNUCC) IF(UNIX) - FindPthreads() - IF(PTHREADS_FOUND) - ADD_DEFINITIONS(${PTHREADS_CFLAGS}) - LINK_LIBRARIES(${PTHREADS_LIBS}) - add_compile_definitions(HAVE_PTHREAD) - ELSE(PTHREADS_FOUND) - MESSAGE( - FATAL_ERROR - "Could not detect threading flags.\n" - "Try specifying them manually in PTHREADS_CFLAGS and PTHREADS_LIBS." - ) - ENDIF(PTHREADS_FOUND) + FindPthreads() + IF(PTHREADS_FOUND) + ADD_DEFINITIONS(${PTHREADS_CFLAGS}) + LINK_LIBRARIES(${PTHREADS_LIBS}) + add_definitions(-DHAVE_PTHREAD) + ELSE(PTHREADS_FOUND) + MESSAGE( + FATAL_ERROR + "Could not detect threading flags.\n" + "Try specifying them manually in PTHREADS_CFLAGS and PTHREADS_LIBS." + ) + ENDIF(PTHREADS_FOUND) ELSEIF(WIN32) ADD_DEFINITIONS(-DNOMINMAX) ENDIF(UNIX) @@ -56,34 +58,34 @@ IF(NOT HAVE_STDINT_H) INCLUDE_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}") ELSE(NOT HAVE_STDINT_H) FILE(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/stdint.h") - add_compile_definitions(HAVE_STDINT_H) + add_definitions(-DHAVE_STDINT_H) ENDIF(NOT HAVE_STDINT_H) #some required params which aren't checked in hope your system have them -add_compile_definitions(HAVE_STDINCLUDES HAS_WCHAR HAVE_MBSTATE_T HAVE_NAMESPACES) +add_definitions(-DHAVE_STDINCLUDES -DHAS_WCHAR -DHAVE_MBSTATE_T -DHAVE_NAMESPACES) FIND_PATH( FI_INCLUDE_DIR FreeImage.h - PATHS /usr/local/include /usr/include - DOC "Path to libfreeimage headers." + PATHS /usr/local/include /usr/include + DOC "Path to libfreeimage headers." ) IF(NOT FI_INCLUDE_DIR) MESSAGE( - FATAL_ERROR - "Could not find libfreeimage headers.\n" - "You may need to install a package named libfreeimage-dev or similarly." - ) + FATAL_ERROR + "Could not find libfreeimage headers.\n" + "You may need to install a package named libfreeimage-dev or similarly." + ) ENDIF() -INCLUDE_DIRECTORIES("${FI_INCLUDE_DIR}" +INCLUDE_DIRECTORIES("${FI_INCLUDE_DIR}" "${djvu_libre_sources_path}libdjvu/" # should contain GString.h etc. - "${djvu_libre_sources_path}tools/" # should contain common.h + "${djvu_libre_sources_path}tools/" # should contain common.h ) FIND_LIBRARY( FI_LIBRARY freeimage - PATHS /usr/local/lib /usr/lib - DOC "Path to libfreeimage library." + PATHS /usr/local/lib /usr/lib + DOC "Path to libfreeimage library." ) IF(NOT FI_LIBRARY) MESSAGE( @@ -95,16 +97,16 @@ ENDIF() SET( djvu_libre_sources - ${libdjvu}Arrays.cpp ${libdjvu}ByteStream.cpp - ${libdjvu}DjVuFile.cpp ${libdjvu}DjVuInfo.cpp - ${libdjvu}DjVuMessage.cpp ${libdjvu}DjVuMessageLite.cpp - ${libdjvu}GBitmap.cpp ${libdjvu}GContainer.cpp ${libdjvu}GException.cpp - ${libdjvu}GOS.cpp ${libdjvu}GPixmap.cpp ${libdjvu}GRect.cpp ${libdjvu}GSmartPointer.cpp - ${libdjvu}GString.cpp ${libdjvu}GThreads.cpp ${libdjvu}GURL.cpp ${libdjvu}GUnicode.cpp - ${libdjvu}IFFByteStream.cpp ${libdjvu}IW44EncodeCodec.cpp ${libdjvu}IW44Image.cpp - ${libdjvu}JB2EncodeCodec.cpp - ${libdjvu}MMX.cpp ${libdjvu}UnicodeByteStream.cpp ${libdjvu}XMLParser.cpp ${libdjvu}XMLTags.cpp - ${libdjvu}ZPCodec.cpp + ${libdjvu}Arrays.cpp ${libdjvu}ByteStream.cpp + ${libdjvu}DjVuFile.cpp ${libdjvu}DjVuInfo.cpp + ${libdjvu}DjVuMessage.cpp ${libdjvu}DjVuMessageLite.cpp + ${libdjvu}GBitmap.cpp ${libdjvu}GContainer.cpp ${libdjvu}GException.cpp + ${libdjvu}GOS.cpp ${libdjvu}GPixmap.cpp ${libdjvu}GRect.cpp ${libdjvu}GSmartPointer.cpp + ${libdjvu}GString.cpp ${libdjvu}GThreads.cpp ${libdjvu}GURL.cpp ${libdjvu}GUnicode.cpp + ${libdjvu}IFFByteStream.cpp ${libdjvu}IW44EncodeCodec.cpp ${libdjvu}IW44Image.cpp + ${libdjvu}JB2EncodeCodec.cpp + ${libdjvu}MMX.cpp ${libdjvu}UnicodeByteStream.cpp ${libdjvu}XMLParser.cpp ${libdjvu}XMLTags.cpp + ${libdjvu}ZPCodec.cpp ) SET( @@ -115,13 +117,13 @@ SET( IF (WIN32) ADD_EXECUTABLE( c44-fi WIN32 ${sources} ${djvu_libre_sources}) - add_compile_definitions(_WIN32) + add_definitions(-D_WIN32) ELSEIF(APPLE) ADD_EXECUTABLE( c44-fi MACOSX_BUNDLE ${sources} ${djvu_libre_sources}) - add_compile_definitions(macintosh) + add_definitions(-Dmacintosh) ELSE() ADD_EXECUTABLE( c44-fi ${sources} ${djvu_libre_sources}) - add_compile_definitions(UNIX) + add_definitions(-DUNIX) ENDIF() TARGET_LINK_LIBRARIES( diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..9e95b73 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +c44-freeimage (3.5.28-0ubuntu1) bionic; urgency=medium + + * First release on launchpad + + -- Alexander Trufanov Wed, 17 Mar 2021 10:40:00 +0300 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..a98bd70 --- /dev/null +++ b/debian/control @@ -0,0 +1,16 @@ +Source: c44-freeimage +Section: graphics +Priority: optional +Maintainer: Alexander Trufanov +Build-Depends: debhelper-compat (= 9), libgcc1 (>=1.3.0), libc6 (>=2.14), libpng-dev (>=1.6.2), libstdc++6 (>=5.2), cmake (>=2.8.9), libfreeimage-dev (>=3.17) +Standards-Version: 4.5.0 +Homepage: https://github.com/trufanov-nok/c44-freeimage +#Vcs-Browser: https://salsa.debian.org/debian/scantailor-universal +#Vcs-Git: https://salsa.debian.org/debian/scantailor-universal.git +Rules-Requires-Root: no + +Package: c44-freeimage +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Fork of c44 encoder from DjVuLibre that supports most + of the common image formats with help of FreeImage library. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..b49adef --- /dev/null +++ b/debian/copyright @@ -0,0 +1,7 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Source: https://github.com/trufanov-nok/c44-freeimage + +Files: * +Copyright: 2002 Leon Bottou and Yann Le Cun. + 2001 AT&T +License: GPL-2+ diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..5d15a70 --- /dev/null +++ b/debian/rules @@ -0,0 +1,9 @@ +#!/usr/bin/make -f + +export DH_VERBOSE=1 + +%: + dh $@ + +#override_dh_auto_configure: +# git config --system http.sslVerify false && git clone https://github.com/barak/djvulibre.git && dh_auto_configure diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/src/c44-fi.cpp b/src/c44-fi.cpp index 39fdede..e422cd2 100644 --- a/src/c44-fi.cpp +++ b/src/c44-fi.cpp @@ -706,7 +706,7 @@ FreeImage error handler void FreeImageErrorHandler(FREE_IMAGE_FORMAT fif, const char *message) { printf("\n*** "); printf("%s Format\n", FreeImage_GetFormatFromFIF(fif)); - printf(message); + printf("%s", message); printf(" ***\n"); }