diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..b69a03dcb81fa16cf7236cd75b45dde30c094ba1 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,141 @@ +cmake_minimum_required(VERSION 2.6.0) + +project(giflib C) + +SET(BUILD_STATIC_LIBS OFF CACHE BOOL "Whether to also build static libs") + +execute_process(COMMAND ./getversion + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + OUTPUT_VARIABLE VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE +) + +set(LIBMAJOR 7) +set(LIBMINOR 1) +set(LIBPOINT 0) +set(LIBVER "${LIBMAJOR}.${LIBMINOR}.${LIBPOINT}") + +set(giflib_SRC + dgif_lib.c + egif_lib.c + getarg.c + gifalloc.c + gif_err.c + gif_font.c + gif_hash.c + openbsd-reallocarray.c + qprintf.c + quantize.c +) + +# Some utilities are installed +set(giflib_INSTALLABLE + gif2rgb + gifbuild + giffix + giftext + giftool + gifclrmp +) + +# Some utilities are only used internally for testing. +# There is a parallel list in doc/Makefile. +# These are all candidates for removal in future releases. +set(giflib_UTILS + ${giflib_INSTALLABLE} + gifbg + gifcolor + gifecho + giffilter + gifhisto + gifinto + gifwedge +) + +file(GLOB giflib_MAN doc/*.1) + +### Build library / tools + +add_library(gif SHARED ${giflib_SRC}) +target_link_libraries(gif m) +set_target_properties(gif PROPERTIES VERSION ${LIBVER} SOVERSION ${LIBMAJOR}) +if(WIN32) + set_target_properties(gif PROPERTIES SUFFIX "-${LIBMAJOR}${CMAKE_SHARED_LIBRARY_SUFFIX}") +endif(WIN32) + +if(${BUILD_STATIC_LIBS}) + add_library(gif_static STATIC ${giflib_SRC}) + set_target_properties(gif_static PROPERTIES OUTPUT_NAME gif) +endif(${BUILD_STATIC_LIBS}) + + +foreach(UTILITY ${giflib_UTILS}) + add_executable(${UTILITY} ${UTILITY}.c) + target_link_libraries(${UTILITY} gif) +endforeach() + +### Installation + +install(TARGETS gif + RUNTIME DESTINATION bin + ARCHIVE DESTINATION lib${LIB_SUFFIX} + LIBRARY DESTINATION lib${LIB_SUFFIX} +) + +if(${BUILD_STATIC_LIBS}) + install(TARGETS gif_static ARCHIVE DESTINATION lib${LIB_SUFFIX}) +endif(${BUILD_STATIC_LIBS}) + +foreach(UTILITY ${giflib_UTILS}) + install(TARGETS ${UTILITY} DESTINATION bin) +endforeach() + +install(FILES gif_lib.h DESTINATION include) +install(FILES ${giflib_MAN} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man1) + + +### Distribution tarball +set(giflib_DIST + *.c + *.h + README + NEWS + TODO + COPYING + getversion + ChangeLog + CMakeLists.txt + build.adoc + history.adoc + control + doc/whatsinagif + doc/*.1 + doc/*.xml + doc/*.txt + doc/index.html.in + doc/00README + doc/Makefile + tests + pic +) +# We include all of the XML, and also generated manual pages +# so people working from the distribution tarball won't need xmlto. +add_custom_target(dist-gz + COMMAND tar --transform='s:^:giflib-${VERSION}/:' -czf giflib-${VERSION}.tar.gz ${giflib_DIST} + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} +) + +add_custom_target(dist-bz2 + COMMAND tar --transform='s:^:giflib-${VERSION}/:' -cjf giflib-${VERSION}.tar.bz2 ${giflib_DIST} + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} +) + +add_custom_target(dist DEPENDS dist-gz DEPENDS dist-bz2) + + +### Auditing tools + +# cppcheck should run clean +add_custom_target(cppcheck + COMMAND cppcheck --inline-suppr --template gcc --enable=all --suppress=unusedFunction --force *.[ch] +) diff --git a/giflib-5.2.1.tar.gz b/giflib-5.2.1.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..f5555f590d7247a1d0995d576fb28e21a833084b Binary files /dev/null and b/giflib-5.2.1.tar.gz differ diff --git a/giflib.spec b/giflib.spec new file mode 100644 index 0000000000000000000000000000000000000000..86c156116ff6ef6022f9046625f71b92195c7c41 --- /dev/null +++ b/giflib.spec @@ -0,0 +1,144 @@ +%define anolis_release 1 +Name: giflib +Summary: A library and utilities for processing GIFs +Version: 5.2.1 +Release: %{anolis_release}%{dist} + +License: MIT +URL: http://www.sourceforge.net/projects/%{name}/ +Source: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz +# Downstream cmake support +Source1: CMakeLists.txt + +BuildRequires: cmake +BuildRequires: gcc +BuildRequires: xmlto + +BuildRequires: mingw32-filesystem >= 95 +BuildRequires: mingw32-gcc + +BuildRequires: mingw64-filesystem >= 95 +BuildRequires: mingw64-gcc + + +%description +giflib is a library for reading and writing gif images. + + +%package devel +Summary: Development files for programs using the giflib library +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description devel +The giflib-devel package includes header files, libraries necessary for +developing programs which use the giflib library. + + +%package utils +Summary: Programs for manipulating GIF format image files +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description utils +The giflib-utils package contains various programs for manipulating GIF +format image files. + +%package -n mingw32-%{name} +Summary: MinGW Windows %{name} library +Obsoletes: mingw32-%{name}-static +BuildArch: noarch + +%description -n mingw32-%{name} +%{summary}. + + +%package -n mingw32-%{name}-tools +Summary: Tools for the MinGW Windows %{name} library +Requires: mingw32-%{name} = %{version}-%{release} +BuildArch: noarch + +%description -n mingw32-%{name}-tools +%{summary}. + + +%package -n mingw64-%{name} +Summary: MinGW Windows %{name} library +Obsoletes: mingw64-%{name}-static +BuildArch: noarch + +%description -n mingw64-%{name} +%{summary}. + + +%package -n mingw64-%{name}-tools +Summary: Tools for the MinGW Windows %{name} library +Requires: mingw64-%{name} = %{version}-%{release} +BuildArch: noarch + +%description -n mingw64-%{name}-tools +%{summary}. + + +%{?mingw_debug_package} + + +%prep +%autosetup -p1 +cp -a %{SOURCE1} . + + +%build +# Native build +%cmake +%cmake_build + +# MinGW build +%mingw_cmake +%mingw_make_build + + +%install +%cmake_install +%mingw_make_install +rm -rf %{buildroot}%{mingw32_mandir} +rm -rf %{buildroot}%{mingw64_mandir} + + +%mingw_debug_install_post + + +%files +%doc ChangeLog NEWS README +%license COPYING +%{_libdir}/libgif.so.7* + +%files devel +%doc doc/* +%{_libdir}/libgif.so +%{_includedir}/gif_lib.h + +%files utils +%{_bindir}/gif* +%{_mandir}/man1/*.1* + +%files -n mingw32-%{name} +%license COPYING +%{mingw32_bindir}/libgif-7.dll +%{mingw32_includedir}/gif_lib.h +%{mingw32_libdir}/libgif.dll.a + +%files -n mingw32-%{name}-tools +%{mingw32_bindir}/*.exe + +%files -n mingw64-%{name} +%license COPYING +%{mingw64_bindir}/libgif-7.dll +%{mingw64_includedir}/gif_lib.h +%{mingw64_libdir}/libgif.dll.a + +%files -n mingw64-%{name}-tools +%{mingw64_bindir}/*.exe + + +%changelog +* Wed Apr 13 2022 Zhongling He 5.2.1-1 +- Init package from upstream v5.2.1