## START: Set by rpmautospec
## (rpmautospec version 0.7.3)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
    release_number = 1;
    base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
    print(release_number + base_release_number - 1);
}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
## END: Set by rpmautospec

Name:           pstoedit
Version:        4.02
Release:        %autorelease
Summary:        Translates PostScript and PDF graphics into other vector formats
License:        GPL-2.0-or-later
URL:            http://www.pstoedit.net
Source0:        https://sourceforge.net/projects/pstoedit/files/pstoedit/%{version}/pstoedit-%{version}.tar.gz

# Fix cflags of the pkg-config file
Patch0:         pstoedit-pkglibdir.patch

# drvpptx.cpp:68:1: note: 'std::unique_ptr' is defined in header '<memory>'; did you forget to '#include <memory>'?
Patch1:         pstoedit-fix-gcc12.patch

BuildRequires:  make
BuildRequires:  gd-devel
BuildRequires:  dos2unix
BuildRequires:  ghostscript
BuildRequires:  plotutils-devel
BuildRequires:  %{?dts}gcc-c++, %{?dts}gcc
BuildRequires:  libzip-devel
%if ! (0%{?rhel} >= 8)
BuildRequires:  ImageMagick-c++-devel
%endif
BuildRequires:  libEMF-devel
Requires:       ghostscript%{?_isa}

%description
Pstoedit converts PostScript and PDF files to various vector graphic
formats. The resulting files can be edited or imported into various
drawing packages. Pstoedit comes with a large set of integrated format
drivers


%package devel
Summary:        Headers for developing programs that will use %{name}
Requires:       %{name}%{?_isa} = %{version}-%{release}

%description devel
This package contains the header files needed for developing %{name}
applications


%prep
%autosetup -N

%patch -P 0 -p1
%if 0%{?fedora} || 0%{?rhel} > 9
%patch -P 1 -p1
%endif

dos2unix doc/*.htm doc/readme.txt

%build
%configure --disable-static --enable-docs=no --with-libzip-include=%{_includedir} \
           --with-magick --with-libplot
%make_build

%install
%make_install
mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1
install -pm 644 doc/pstoedit.1 $RPM_BUILD_ROOT%{_mandir}/man1/
find $RPM_BUILD_ROOT -type f -name "*.la" -exec rm -f {} ';'

%files
%doc doc/readme.txt doc/pstoedit.htm doc/changelog.htm doc/pstoedit.pdf
%license copying
%{_datadir}/pstoedit/
%{_mandir}/man1/*
%{_bindir}/pstoedit
%{_libdir}/libpstoedit.so.0.0.0
%{_libdir}/libpstoedit.so.0
%{_libdir}/pstoedit/

%files devel
%doc doc/changelog.htm
%{_includedir}/pstoedit/
%{_libdir}/libpstoedit.so
%{_libdir}/pkgconfig/*.pc
%{_datadir}/aclocal/*.m4


%changelog
## START: Generated by rpmautospec
* Sat Nov 30 2024 Antonio Trande <sagitter@fedoraproject.org> - 4.02-1
- Release 4.02 (rhbz#2272091)

* Fri Jul 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 4.01-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild

* Thu Mar 28 2024 Antonio Trande <sagitter@fedoraproject.org> - 4.01-1
- Release 4.01

* Fri Jan 26 2024 Fedora Release Engineering <releng@fedoraproject.org> - 4.00-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild

* Sun Jan 21 2024 Fedora Release Engineering <releng@fedoraproject.org> - 4.00-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild

* Sat Jul 22 2023 Antonio Trande <sagitter@fedoraproject.org> - 4.00-4
- Fix Patch2

* Fri Jul 21 2023 Yaakov Selkowitz <yselkowi@redhat.com> - 4.00-3
- Fix C usage of pstoedit.h

* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 4.00-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild

* Tue Jun 20 2023 Antonio Trande <sagitter@fedoraproject.org> - 4.00-1
- Release 4.00

* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 3.78-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild

* Thu Jan 05 2023 Neal Gompa <ngompa@fedoraproject.org> - 3.78-8
- Rebuild for ImageMagick 7

* Wed Nov 23 2022 Yaakov Selkowitz <yselkowitz@fedoraproject.org> - 3.78-7
- Fix ELN build

* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 3.78-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild

* Fri May 20 2022 Sérgio M. Basto <sergio@serjux.com> - 3.78-5
- ImageMagick is not intended to be on RHEL >= 8 (just on EPEL)

* Wed May 11 2022 Sérgio M. Basto <sergio@serjux.com> - 3.78-4
- Fix commit dfc84e9 but ImageMagick is now available on EPEL 8 and

* Fri Jan 28 2022 Antonio Trande <sagitter@fedoraproject.org> - 3.78-3
- Add fix for GCC-12

* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 3.78-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild

* Tue Nov 23 2021 Antonio Trande <sagitter@fedoraproject.org> - 3.78-1
- Release 3.78

* Sat Sep 04 2021 Antonio Trande <sagitter@fedoraproject.org> - 3.77-1
- Release 3.77

* Mon Aug 30 2021 Antonio Trande <sagitter@fedoraproject.org> - 3.76-1
- Release 3.76

* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.75-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild

* Tue Jun 15 2021 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 3.75-9
- Drop dependency on ming

* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.75-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild

* Fri Jan 08 2021 Tom Stellard <tstellar@redhat.com> - 3.75-7
- Add BuildRequires: make

* Thu Jan 07 2021 Tomas Popela <tomas.popela@gmail.com> - 3.75-6
- Disable ImageMagick support in ELN/RHEL 8+ as ImageMagick isn't part of
  it

* Mon Oct 05 2020 sagitter <sagitter@fedoraproject.org> - 3.75-5
- Rebase to 3.75| Remove duplicate doc directory on EPEL7

* Mon Oct 05 2020 sagitter <sagitter@fedoraproject.org> - 3.75-4
- Rebase to 3.75| Use devtoolset-9 on EPEL7

* Mon Oct 05 2020 sagitter <sagitter@fedoraproject.org> - 3.75-3
- Rebase to 3.75| Fix build commands

* Mon Oct 05 2020 sagitter <sagitter@fedoraproject.org> - 3.75-2
- Fix EPEL builds

* Mon Oct 05 2020 sagitter <sagitter@fedoraproject.org> - 3.75-1
- Rebase to 3.75

* Sat Aug 01 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.73-11
- Second attempt - Rebuilt for
  https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild

* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.73-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild

* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.73-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild

* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.73-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild

* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.73-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

* Mon Jan 28 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 3.73-6
- Remove obsolete Group tag

* Tue Jan 22 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 3.73-5
- Remove obsolete ldconfig scriptlets

* Tue Jul 24 2018 Sebastian Kisela <skisela@redhat.com> - 3.73-4
- Add explicit gcc-c++ BuildRequires to fix build

* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.73-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Mon Jul 09 2018 Sebastian Kisela <skisela@redhat.com> - 3.73-2
- Add sources for 3.73 rebase

* Mon Jul 09 2018 Sebastian Kisela <skisela@redhat.com> - 3.73-1
- Rebase to 3.73 upstream version

* Mon Apr 16 2018 Sebastian Kisela <skisela@redhat.com> - 3.70-3
- Revert sources back to 3.70

* Mon Apr 16 2018 Sebastian Kisela <skisela@redhat.com> - 3.70-2
- Revert build to new release 3.71

* Mon Apr 16 2018 Sebastian Kisela <skisela@redhat.com> - 3.70-1
- Revert "- New upstream release 3.71"

* Mon Apr 16 2018 Sebastian Kisela <skisela@redhat.com> - 3.71-2
- Upload sources for 3.71 release

* Mon Apr 16 2018 Sebastian Kisela <skisela@redhat.com> - 3.71-1
- New upstream release 3.71

* Fri Apr 13 2018 Sebastian Kisela <skisela@redhat.com> - 3.70-11
- Remove LIBPNG_LDFLAGS from config

* Fri Apr 13 2018 Jiri Popelka <jpopelka@redhat.com> - 3.70-10
- test

* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.70-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.70-8
- Rebuilt for
  https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild

* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.70-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.70-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 3.70-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Mon Jul 27 2015 Jiri Popelka <jpopelka@redhat.com> - 3.70-4
- RPMAUTOSPEC: unresolvable merge
## END: Generated by rpmautospec