archrelease: copy trunk to community-any
[ArchLinux/community.git] / libfm / trunk / PKGBUILD
blob3d0a23bd0ac2f2ee45bd72bac01d830fe62b3538
1 # Maintainer: Balló György <ballogyor+arch at gmail dot com>
2 # Contributor: Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
3 # Contributor: Unknown47 <unknown47r@gmail.com>
4 # Contributor: Angel Velasquez <angvp@archlinux.org>
5 # Contributor: Juergen Hoetzel <juergen@archlinux.org>
7 pkgbase=libfm
8 pkgname=(libfm libfm-extra libfm-gtk2 libfm-gtk3)
9 pkgver=1.3.2
10 pkgrel=1
11 pkgdesc='Library for file management'
12 url='https://lxde.org/'
13 arch=('x86_64')
14 license=('GPL')
15 depends=('gtk2' 'gtk3' 'libexif' 'menu-cache')
16 makedepends=('intltool' 'gtk-doc')
17 source=(https://downloads.sourceforge.net/pcmanfm/libfm-$pkgver.tar.xz)
18 sha256sums=('a5042630304cf8e5d8cff9d565c6bd546f228b48c960153ed366a34e87cad1e5')
20 prepare() {
21   cd $pkgbase-$pkgver
22   # Update xarchiver option
23   # https://github.com/lxde/libfm/issues/35
24   sed -i 's/create=xarchiver --add-to %F/create=xarchiver --compress %F/' data/archivers.list
26   autoreconf -fi
29 build() {
30   # GTK+ 2 version
31   [ -d gtk2 ] || cp -r $pkgbase-$pkgver gtk2
32   cd gtk2
33   ./configure --prefix=/usr \
34     --sysconfdir=/etc \
35     --with-gnu-ld \
36     --enable-gtk-doc
38   #https://bugzilla.gnome.org/show_bug.cgi?id=656231
39   sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
41   make
43   cd "$srcdir"
44   # GTK+ 3 version
45   [ -d gtk3 ] || cp -r $pkgbase-$pkgver gtk3
46   cd gtk3
47   ./configure --prefix=/usr \
48     --sysconfdir=/etc \
49     --with-gnu-ld \
50     --with-gtk=3
52   #https://bugzilla.gnome.org/show_bug.cgi?id=656231
53   sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
55   make
58 package_libfm() {
59   depends=('libexif' "libfm-extra=$pkgver" 'menu-cache')
60   
61   cd gtk2
62   make DESTDIR="$pkgdir" install
64   # Temporary fix to FS#32361
65   rm -rf "$pkgdir"/usr/include/libfm
66   mv "$pkgdir"/usr/include/libfm-1.0/ "$pkgdir"/usr/include/libfm
68   # Split libfm-extra
69   [[ -d "$srcdir/libfm-extra" ]] && rm -r "$srcdir/libfm-extra/"
70   mkdir "$srcdir"/libfm-extra
71   mv "$pkgdir"/usr/include/libfm/fm-{extra,version,xml-file}.h \
72      "$pkgdir"/usr/lib/libfm-extra.* \
73      "$pkgdir"/usr/lib/pkgconfig/libfm-extra.pc \
74      "$srcdir/libfm-extra/"
76   # Split libfm-gtk2
77   [[ -d "$srcdir/libfm-gtk2" ]] && rm -r "$srcdir/libfm-gtk2/"
78   mkdir "$srcdir"/libfm-gtk2
79   mv "$pkgdir/usr/bin" \
80      "$pkgdir"/usr/lib/libfm-gtk.* \
81      "$pkgdir"/usr/lib/libfm/modules/gtk-* \
82      "$pkgdir/usr/lib/pkgconfig/libfm-gtk.pc" \
83      "$pkgdir/usr/share/applications" \
84      "$pkgdir/usr/share/man" \
85      "$srcdir/libfm-gtk2/"
88 package_libfm-extra() {
89   pkgdesc="Extra library for file management" 
90   depends=('glib2')
92   cd "$srcdir"/libfm-extra
93   mkdir -p "$pkgdir"/usr/{include/libfm,lib/pkgconfig}
94   mv *.h "$pkgdir/usr/include/libfm"
95   mv libfm-extra.so* "$pkgdir/usr/lib"
96   mv libfm-extra.pc "$pkgdir/usr/lib/pkgconfig"
99 package_libfm-gtk2() {
100   pkgdesc='GTK+ 2 library for file management'
101   depends=('gtk2' 'menu-cache' "libfm=$pkgver")
102   replaces=('lxshortcut')
103   provides=('lxshortcut')
104   conflicts=('lxshortcut')
106   cd "$srcdir"/libfm-gtk2
107   mkdir -p "$pkgdir"/usr/{lib/{libfm/modules,pkgconfig},share}
108   mv bin "$pkgdir/usr"
109   mv libfm-gtk.so* "$pkgdir"/usr/lib
110   mv gtk-* "$pkgdir"/usr/lib/libfm/modules
111   mv libfm-gtk.pc "$pkgdir/usr/lib/pkgconfig"
112   mv applications "$pkgdir/usr/share"
113   mv man "$pkgdir/usr/share"
116 package_libfm-gtk3() {
117   pkgdesc='GTK+ 3 library for file management'
118   depends=('gtk3' 'menu-cache' "libfm=$pkgver")
119   conflicts=('libfm-gtk2' 'lxshortcut')
121   cd gtk3
122   make DESTDIR="$srcdir"/libfm-gtk3 install
124   cd "$srcdir"/libfm-gtk3
125   mkdir -p "$pkgdir"/usr/{lib/{libfm/modules,pkgconfig},share}
126   mv usr/bin "$pkgdir/usr"
127   mv usr/lib/libfm-gtk3.so* "$pkgdir"/usr/lib
128   mv usr/lib/libfm/modules/gtk-* "$pkgdir"/usr/lib/libfm/modules
129   mv usr/lib/pkgconfig/libfm-gtk3.pc "$pkgdir/usr/lib/pkgconfig"
130   mv usr/share/applications "$pkgdir/usr/share"
131   mv usr/share/man "$pkgdir/usr/share"