1SUMMARY="Aldus/Macromedia/Adobe FreeHand import library"
2DESCRIPTION="libcdr is a library that parses the file format of \
3Aldus/Macromedia/Adobe FreeHand documents of all versions."
4HOMEPAGE="https://wiki.documentfoundation.org/DLP/Libraries/libfreehand"
5COPYRIGHT="Fridrich Strba, David Tardon"
6LICENSE="MPL v2.0"
7REVISION="5"
8SOURCE_URI="http://dev-www.libreoffice.org/src/libfreehand/libfreehand-$portVersion.tar.bz2"
9CHECKSUM_SHA256="1ff634f2b34223a1ab406284bb5a7de1d0d76b5da9cf7832af0a80a6b7d962f1"
10PATCHES="libfreehand-$portVersion.patchset"
11
12ARCHITECTURES="all !x86_gcc2"
13SECONDARY_ARCHITECTURES="x86"
14
15commandBinDir=$binDir
16commandSuffix=$secondaryArchSuffix
17if [ "$targetArchitecture" = x86_gcc2 ]; then
18	commandSuffix=
19	commandBinDir=$prefix/bin
20fi
21
22libVersion="1.0.2"
23libVersionCompat="$libVersion compat >= ${libVersion%%.*}"
24
25PROVIDES="
26	libfreehand$secondaryArchSuffix = $portVersion
27	lib:libfreehand_0.1$secondaryArchSuffix = $libVersionCompat
28	"
29REQUIRES="
30	haiku$secondaryArchSuffix
31	lib:liblcms2$secondaryArchSuffix
32	lib:librevenge_0.0$secondaryArchSuffix
33	lib:librevenge_generators_0.0$secondaryArchSuffix
34	lib:librevenge_stream_0.0$secondaryArchSuffix
35	lib:libz$secondaryArchSuffix
36	"
37
38PROVIDES_devel="
39	libfreehand${secondaryArchSuffix}_devel = $portVersion
40	devel:libfreehand_0.1$secondaryArchSuffix = $libVersionCompat
41	"
42REQUIRES_devel="
43	libfreehand$secondaryArchSuffix == $portVersion base
44	"
45
46PROVIDES_tools="
47	libfreehand${secondaryArchSuffix}_tools = $portVersion
48	cmd:fh2raw$commandSuffix
49	cmd:fh2svg$commandSuffix
50	cmd:fh2text$commandSuffix
51	"
52REQUIRES_tools="
53	libfreehand$secondaryArchSuffix == $portVersion base
54	$REQUIRES
55	"
56
57BUILD_REQUIRES="
58	haiku${secondaryArchSuffix}_devel
59	devel:libboost_system$secondaryArchSuffix >= 1.83.0
60	devel:libcppunit$secondaryArchSuffix
61	devel:libicuuc$secondaryArchSuffix >= 74
62	devel:liblcms2$secondaryArchSuffix
63	devel:librevenge_0.0$secondaryArchSuffix
64	devel:librevenge_generators_0.0$secondaryArchSuffix
65	devel:librevenge_stream_0.0$secondaryArchSuffix
66	devel:libz$secondaryArchSuffix
67	"
68BUILD_PREREQUIRES="
69	cmd:aclocal
70	cmd:autoconf
71	cmd:autoheader
72	cmd:automake
73	cmd:gcc$secondaryArchSuffix
74	cmd:gperf
75	cmd:ld$secondaryArchSuffix
76	cmd:libtoolize$secondaryArchSuffix
77	cmd:make
78	cmd:pkg_config$secondaryArchSuffix
79	"
80
81defineDebugInfoPackage libfreehand$secondaryArchSuffix \
82	$libDir/libfreehand-0.1.so.$libVersion
83
84BUILD()
85{
86	autoreconf -fi
87	runConfigure --omit-dirs binDir ./configure \
88			--bindir=$commandBinDir \
89			enable_werror=no
90	make $jobArgs
91}
92
93INSTALL()
94{
95	make install
96
97	rm $libDir/libfreehand-0.1.la
98
99	prepareInstalledDevelLib libfreehand-0.1
100	fixPkgconfig
101
102	packageEntries devel \
103		$developDir
104
105	packageEntries tools \
106		$commandBinDir
107}
108