diff --git a/libdmtx-0.7.5-c99.patch b/libdmtx-0.7.5-c99.patch new file mode 100644 index 0000000..1ccf17f --- /dev/null +++ b/libdmtx-0.7.5-c99.patch @@ -0,0 +1,36 @@ +diff -up libdmtx-0.7.5/test/multi_test/Makefile.am.std libdmtx-0.7.5/test/multi_test/Makefile.am +--- libdmtx-0.7.5/test/multi_test/Makefile.am.std 2018-04-06 13:14:23.000000000 +0200 ++++ libdmtx-0.7.5/test/multi_test/Makefile.am 2018-04-06 13:14:27.000000000 +0200 +@@ -1,4 +1,4 @@ +-AM_CPPFLAGS = -Wshadow -Wall -pedantic -ansi ++AM_CPPFLAGS = -Wshadow -Wall -pedantic -std=c99 + + check_PROGRAMS = multi_test + +diff -up libdmtx-0.7.5/test/rotate_test/Makefile.am.std libdmtx-0.7.5/test/rotate_test/Makefile.am +--- libdmtx-0.7.5/test/rotate_test/Makefile.am.std 2018-04-06 13:14:13.000000000 +0200 ++++ libdmtx-0.7.5/test/rotate_test/Makefile.am 2018-04-06 13:14:18.000000000 +0200 +@@ -1,4 +1,4 @@ +-AM_CPPFLAGS = -Wshadow -Wall -pedantic -ansi ++AM_CPPFLAGS = -Wshadow -Wall -pedantic -std=c99 + + check_PROGRAMS = rotate_test + +diff -up libdmtx-0.7.5/test/simple_test/Makefile.am.std libdmtx-0.7.5/test/simple_test/Makefile.am +--- libdmtx-0.7.5/test/simple_test/Makefile.am.std 2018-04-06 13:13:59.000000000 +0200 ++++ libdmtx-0.7.5/test/simple_test/Makefile.am 2018-04-06 13:14:04.000000000 +0200 +@@ -1,4 +1,4 @@ +-AM_CPPFLAGS = -Wshadow -Wall -pedantic -ansi ++AM_CPPFLAGS = -Wshadow -Wall -pedantic -std=c99 + + check_PROGRAMS = simple_test + +diff -up libdmtx-0.7.5/test/unit_test/Makefile.am.std libdmtx-0.7.5/test/unit_test/Makefile.am +--- libdmtx-0.7.5/test/unit_test/Makefile.am.std 2018-04-06 13:13:41.000000000 +0200 ++++ libdmtx-0.7.5/test/unit_test/Makefile.am 2018-04-06 13:13:53.000000000 +0200 +@@ -1,4 +1,4 @@ +-AM_CPPFLAGS = -Wshadow -Wall -pedantic -ansi ++AM_CPPFLAGS = -Wshadow -Wall -pedantic -std=c99 + + check_PROGRAMS = unit_test + diff --git a/libdmtx-0.7.5-math.patch b/libdmtx-0.7.5-math.patch new file mode 100644 index 0000000..41c7557 --- /dev/null +++ b/libdmtx-0.7.5-math.patch @@ -0,0 +1,11 @@ +diff -up libdmtx-0.7.5/test/simple_test/simple_test.c.math libdmtx-0.7.5/test/simple_test/simple_test.c +--- libdmtx-0.7.5/test/simple_test/simple_test.c.math 2018-04-06 13:19:44.000000000 +0200 ++++ libdmtx-0.7.5/test/simple_test/simple_test.c 2018-04-06 13:19:52.000000000 +0200 +@@ -18,6 +18,7 @@ + #include + #include + #include ++#include + #include + + int diff --git a/libdmtx-0.7.5-size_t.patch b/libdmtx-0.7.5-size_t.patch new file mode 100644 index 0000000..6dc5fce --- /dev/null +++ b/libdmtx-0.7.5-size_t.patch @@ -0,0 +1,29 @@ +diff -up libdmtx-0.7.5/test/simple_test/simple_test.c.size_t libdmtx-0.7.5/test/simple_test/simple_test.c +--- libdmtx-0.7.5/test/simple_test/simple_test.c.size_t 2018-04-06 13:16:35.000000000 +0200 ++++ libdmtx-0.7.5/test/simple_test/simple_test.c 2018-04-06 13:17:14.000000000 +0200 +@@ -58,9 +58,9 @@ main(int argc, char *argv[]) + + dmtxEncodeDestroy(&enc); + +- fprintf(stdout, "width: \"%d\"\n", width); +- fprintf(stdout, "height: \"%d\"\n", height); +- fprintf(stdout, "bpp: \"%d\"\n", bytesPerPixel); ++ fprintf(stdout, "width: \"%zd\"\n", width); ++ fprintf(stdout, "height: \"%zd\"\n", height); ++ fprintf(stdout, "bpp: \"%zd\"\n", bytesPerPixel); + + for (int i=0; iarraySize : \"%d\"\n", msg->arraySize ); +- fprintf(stdout, "msg->codeSize : \"%d\"\n", msg->codeSize ); +- fprintf(stdout, "msg->outputSize: \"%d\"\n", msg->outputSize); ++ fprintf(stdout, "msg->arraySize : \"%zd\"\n", msg->arraySize ); ++ fprintf(stdout, "msg->codeSize : \"%zd\"\n", msg->codeSize ); ++ fprintf(stdout, "msg->outputSize: \"%zd\"\n", msg->outputSize); + int oned = sqrt(msg->arraySize); + for (int i=0; iarraySize; i++){ + fprintf(stdout, " %c.", msg->array[i]); diff --git a/libdmtx-0.7.5.tar.gz b/libdmtx-0.7.5.tar.gz new file mode 100644 index 0000000..05dae8e Binary files /dev/null and b/libdmtx-0.7.5.tar.gz differ diff --git a/libdmtx.spec b/libdmtx.spec new file mode 100644 index 0000000..d04a714 --- /dev/null +++ b/libdmtx.spec @@ -0,0 +1,87 @@ +Name: libdmtx +Version: 0.7.5 +Release: 1 +Summary: Library for working with Data Matrix 2D bar-codes + +License: BSD +URL: https://github.com/dmtx +Source0: https://github.com/dmtx/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz +# https://github.com/dmtx/libdmtx/pull/13 +Patch0: libdmtx-0.7.5-c99.patch +# https://github.com/dmtx/libdmtx/pull/14 +Patch1: libdmtx-0.7.5-size_t.patch +# https://github.com/dmtx/libdmtx/pull/12 +Patch2: libdmtx-0.7.5-math.patch + +BuildRequires: gcc +BuildRequires: libtool +BuildRequires: make +Obsoletes: php-libdmtx < 0.7.4 +Obsoletes: python-libdmtx < 0.7.4 +Obsoletes: ruby-libdmtx < 0.7.4 + + +%description +libdmtx is open source software for reading and writing Data Matrix 2D +bar-codes on Linux, Unix, OS X, Windows, and mobile devices. At its core +libdmtx is a shared library, allowing C/C++ programs to use its capabilities +without restrictions or overhead. + +The included utility programs, dmtxread and dmtxwrite, provide the official +interface to libdmtx from the command line, and also serve as a good reference +for programmers who wish to write their own programs that interact with +libdmtx. All of the software in the libdmtx package is distributed under +the LGPLv2 and can be used freely under these terms. + + +%package devel +Summary: Development files for %{name} +Requires: %{name} = %{version}-%{release} + +%description devel +The %{name}-devel package contains libraries and header files for +developing applications that use %{name}. + + +%prep +%autosetup -p1 + +./autogen.sh + + +%build +%configure --disable-static +make %{?_smp_mflags} + + +%install +make install DESTDIR=$RPM_BUILD_ROOT +find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';' + + +%check +make check +pushd test +for t in simple +do + ./${t}_test/${t}_test +done +popd + + +%files +%license LICENSE +%doc AUTHORS ChangeLog KNOWNBUG README README.linux TODO +%{_libdir}/%{name}.so.* + +%files devel +%doc +%{_includedir}/* +%{_libdir}/%{name}.so +%{_libdir}/pkgconfig/%{name}.pc +%{_mandir}/man3/%{name}.3* + + +%changelog +* Thu Jul 14 2022 misaka00251 - 0.7.5-1 +- Init package diff --git a/libdmtx.yaml b/libdmtx.yaml new file mode 100644 index 0000000..e975b31 --- /dev/null +++ b/libdmtx.yaml @@ -0,0 +1,4 @@ +version_control: github +src_repo: dmtx/libdmtx +tag_prefix: "^v" +separator: "."