summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2013-09-13 01:42:57 -0700
committerroot <root@rshg054.dnsready.net>2013-09-13 01:42:57 -0700
commit8996dd88e696bae485c13257572e2f38f5633251 (patch)
tree91d8fe49ec3085cdba925c87616d15f71997e1fa
parent67c663ff9aaeee1572097ef4eceb39c039d91f42 (diff)
Fri Sep 13 01:42:32 PDT 2013
-rw-r--r--community/awesome/PKGBUILD12
-rw-r--r--community/dbmail/PKGBUILD8
-rw-r--r--community/drbd/01-remove-old-sanity-check.diff24
-rw-r--r--community/drbd/PKGBUILD8
-rw-r--r--community/dvdisaster/PKGBUILD28
-rw-r--r--community/dvdisaster/dvdisaster.desktop10
-rw-r--r--community/dvdisaster/dvdisaster.install11
-rw-r--r--community/hedgewars/PKGBUILD8
-rw-r--r--community/hedgewars/hedgewars.desktop8
-rw-r--r--community/ipvsadm/01-fix-not-showing-all-server.patch24
-rw-r--r--community/ipvsadm/PKGBUILD25
-rw-r--r--community/lxdm/PKGBUILD10
-rw-r--r--community/lxdm/default-config.patch3
-rw-r--r--community/lxdm/git-fixes.patch1932
-rw-r--r--community/sigil/PKGBUILD8
-rw-r--r--community/tea/PKGBUILD8
-rw-r--r--community/tix/PKGBUILD30
-rw-r--r--community/torcs/PKGBUILD12
-rw-r--r--community/torcs/torcs.desktop9
-rw-r--r--community/xboard/PKGBUILD9
-rw-r--r--community/xboard/xboard.desktop10
-rw-r--r--extra/ibus/PKGBUILD4
-rw-r--r--extra/ibus/ibus.install19
-rw-r--r--extra/mesa/PKGBUILD21
-rw-r--r--extra/refind-efi/PKGBUILD33
-rw-r--r--extra/tcl/PKGBUILD19
-rw-r--r--extra/transcode/04_ffmpeg_options.patch26
-rw-r--r--extra/transcode/PKGBUILD33
-rw-r--r--extra/transcode/ffmpeg-0.11.patch141
-rw-r--r--extra/transcode/transcode-1.1.7-ffmpeg-0.10.patch15
-rw-r--r--extra/transcode/transcode-1.1.7-ffmpeg-0.11.patch303
-rw-r--r--extra/transcode/transcode-1.1.7-ffmpeg.patch51
-rw-r--r--extra/transcode/transcode-1.1.7-ffmpeg2.patch332
-rw-r--r--extra/transcode/transcode-1.1.7-preset-force.patch28
-rw-r--r--extra/transcode/transcode-1.1.7-preset-free.patch34
-rw-r--r--extra/transcode/transcode-ffmpeg.patch115
-rw-r--r--extra/x2goclient/PKGBUILD11
-rw-r--r--libre/hexchat-libre/PKGBUILD39
-rw-r--r--libre/hexchat-libre/no-firefox.patch16
-rw-r--r--libre/hexchat-libre/remove-non-free-suggestion.patch12
40 files changed, 2717 insertions, 732 deletions
diff --git a/community/awesome/PKGBUILD b/community/awesome/PKGBUILD
index 5b04224ce..d308ec13e 100644
--- a/community/awesome/PKGBUILD
+++ b/community/awesome/PKGBUILD
@@ -1,4 +1,4 @@
-# $Id: PKGBUILD 87494 2013-04-01 17:59:30Z seblu $
+# $Id: PKGBUILD 97098 2013-09-12 18:19:17Z seblu $
# Maintainer: Sébastien Luttringer
# Contributor: xduugu
# Contributor: Ronald van Haren <ronald.archlinux.org>
@@ -6,7 +6,7 @@
pkgname=awesome
pkgver=3.5.1
-pkgrel=1
+pkgrel=2
pkgdesc='Highly configurable framework window manager'
arch=('i686' 'x86_64')
url='http://awesome.naquadah.org/'
@@ -42,10 +42,8 @@ optdepends=(
'vicious: widgets for the Awesome window manager'
)
provides=('notification-daemon')
-source=("$url/download/$pkgname-$pkgver.tar.xz"
- "$pkgname.desktop")
-md5sums=('f528f66ddcdb07f24e6f494837371702'
- '0fdbeec43d211c6750041d7e37611a6a')
+source=("$url/download/$pkgname-$pkgver.tar.xz")
+md5sums=('f528f66ddcdb07f24e6f494837371702')
build() {
cd $pkgname-$pkgver
@@ -61,7 +59,7 @@ package() {
cd $pkgname-$pkgver
make DESTDIR="$pkgdir" install
# install desktop file so you can start awesome from your login manager
- install -Dm644 ../awesome.desktop "$pkgdir/usr/share/xsessions/awesome.desktop"
+ install -Dm644 awesome.desktop "$pkgdir/usr/share/xsessions/awesome.desktop"
}
# vim:set ts=2 sw=2 et:
diff --git a/community/dbmail/PKGBUILD b/community/dbmail/PKGBUILD
index 9fed42cc5..16ee8a445 100644
--- a/community/dbmail/PKGBUILD
+++ b/community/dbmail/PKGBUILD
@@ -1,10 +1,10 @@
-# $Id: PKGBUILD 96964 2013-09-09 11:34:14Z spupykin $
+# $Id: PKGBUILD 97084 2013-09-12 10:40:57Z spupykin $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Sebastian Faltoni <sebastian.faltoni@gmail.com>
pkgname=dbmail
pkgver=3.1.5
-pkgrel=1
+pkgrel=2
pkgdesc="Fast and scalable sql based mail services"
arch=('i686' 'x86_64')
depends=('gmime' 'libzdb' 'mhash' 'libevent')
@@ -29,7 +29,7 @@ source=(http://www.dbmail.org/download/3.1/dbmail-${pkgver}.tar.gz
"dbmail-2.patch::http://git.dbmail.eu/paul/dbmail/patch/?id=d645222c7145127ed7f505e6b8325b5a996d1a74"
"dbmail-3.patch::http://git.dbmail.eu/paul/dbmail/patch/?id=f294d43d0aa115e4c4b6c1dbcf72e6cd00badfd1"
"dbmail-4.patch::http://git.dbmail.eu/paul/dbmail/patch/?id=10c9cb29ea92030b257937d3c49e0b45d15214c3"
- "dbmail-5.patch::http://git.dbmail.eu/paul/dbmail/patch/?id=4c23432cc270554557f9e130331214d81164131b"
+ "dbmail-5_2.patch::http://git.dbmail.eu/paul/dbmail/patch/?id=00fc5c62eeccb87459beecfe76247de4dc961a4c"
"dbmail-6-sieve.patch::http://git.dbmail.eu/paul/dbmail/patch/?id=92b98094a01eda5efe3ba3080e529482d08945a2"
"dbmail-7-systemd.diff")
md5sums=('033e7de6acff49d68beab93632a77761'
@@ -41,7 +41,7 @@ md5sums=('033e7de6acff49d68beab93632a77761'
'8dac89125d01885df97847537733d3dc'
'027bae99982dfe5ef69c598a24d0cd81'
'6a3b8ddbb162894d97d1d9cd3c5b8c4d'
- '2679407f6290494ccc18b135d50dee6e'
+ 'd23aa581582029a1a0d4df977490683e'
'b1063893dd0e74bc0ddee454bb65bf01'
'a781a4ebe2dd75ed635c9b4a239b38d8')
diff --git a/community/drbd/01-remove-old-sanity-check.diff b/community/drbd/01-remove-old-sanity-check.diff
deleted file mode 100644
index 04edb7571..000000000
--- a/community/drbd/01-remove-old-sanity-check.diff
+++ /dev/null
@@ -1,24 +0,0 @@
-From: Lars Ellenberg <lars.ellenberg@linbit.com>
-Date: Thu, 3 Nov 2011 09:40:43 +0000 (+0100)
-Subject: build: remove old sanity check to allow build against linux 3.1
-X-Git-Url: http://git.drbd.org/gitweb.cgi?p=drbd-8.3.git;a=commitdiff_plain;h=790c26b09519b9e02b3a7cf7897fb17c2ae339bf
-
-build: remove old sanity check to allow build against linux 3.1
----
-
-diff --git a/drbd/Makefile b/drbd/Makefile
-index 0985340..7a09603 100644
---- a/drbd/Makefile
-+++ b/drbd/Makefile
-@@ -90,11 +90,6 @@ else
- endif
- endif
-
-- KDIR_Makefile_PATCHLEVEL = $(shell test -e $(KDIR)/Makefile && grep "^PATCHLEVEL = " $(KDIR)/Makefile | cut -d " " -f 3)
-- ifneq ($(findstring $(KDIR_Makefile_PATCHLEVEL),12345),)
-- $(error "won't compile with this kernel version")
-- endif
--
- .PHONY: drbd.o default all greeting clean kbuild install dep tags
-
- drbd.o: greeting kbuild
diff --git a/community/drbd/PKGBUILD b/community/drbd/PKGBUILD
index 62e027320..f8505196c 100644
--- a/community/drbd/PKGBUILD
+++ b/community/drbd/PKGBUILD
@@ -1,9 +1,9 @@
-# $Id: PKGBUILD 90502 2013-05-12 23:31:07Z seblu $
+# $Id: PKGBUILD 97092 2013-09-12 13:47:56Z seblu $
# Maintainer: Sébastien Luttringer
pkgname=drbd
-pkgver=8.4.2
-pkgrel=2
+pkgver=8.4.3
+pkgrel=1
arch=('i686' 'x86_64')
pkgdesc='Userland tools for Distributed Replicated Block Device'
url='http://www.drbd.org'
@@ -12,7 +12,7 @@ depends=('perl' 'bash')
source=("http://oss.linbit.com/drbd/8.4/$pkgname-$pkgver.tar.gz"
"$pkgname.service")
backup=('etc/drbd.conf' 'etc/drbd.d/global_common.conf')
-md5sums=('b081f1046adda1d51ba351c40a8b1107'
+md5sums=('0c54a69603fa28b41de5fb33e03fd9e8'
'7dc909b5895c0b5289d3ee0581d7d333')
prepare() {
diff --git a/community/dvdisaster/PKGBUILD b/community/dvdisaster/PKGBUILD
index 15dcb0a07..494b615bf 100644
--- a/community/dvdisaster/PKGBUILD
+++ b/community/dvdisaster/PKGBUILD
@@ -1,21 +1,27 @@
-# $Id: PKGBUILD 70165 2012-05-01 03:12:33Z ebelanger $
+# $Id: PKGBUILD 97061 2013-09-12 03:38:41Z eric $
# Maintainer: Eric Bélanger <eric@archlinux.org>
pkgname=dvdisaster
pkgver=0.72.4
-pkgrel=1
+pkgrel=2
pkgdesc="Provides a margin of safety against data loss on CD and DVD media caused by aging or scratches"
arch=('i686' 'x86_64')
url="http://www.dvdisaster.com/"
license=('GPL')
-depends=('gtk2')
+depends=('gtk2' 'hicolor-icon-theme')
options=('!makeflags')
-source=(http://dvdisaster.net/downloads/${pkgname}-${pkgver}.tar.bz2 dvdisaster.desktop)
+install=dvdisaster.install
+source=(http://dvdisaster.net/downloads/${pkgname}-${pkgver}.tar.bz2{,.gpg})
sha1sums=('2b47fb5a5535d90641f24a599cd8ae8ffd86b972'
- 'a802dfcee3aa35bdc4b0b5ecabcf32760cd8b992')
+ 'SKIP')
+
+prepare() {
+ cd ${pkgname}-${pkgver}
+ sed -i 's/dvdisaster48/dvdisaster/' contrib/dvdisaster.desktop
+}
build() {
- cd "${srcdir}/${pkgname}-${pkgver}"
+ cd ${pkgname}-${pkgver}
./configure --prefix=/usr \
--mandir=/usr/share/man --docdir=/usr/share/doc \
--localedir=/usr/share/locale \
@@ -24,12 +30,12 @@ build() {
}
package() {
- cd "${srcdir}/${pkgname}-${pkgver}"
+ cd ${pkgname}-${pkgver}
make BUILDROOT="${pkgdir}" install
rm -f "${pkgdir}/usr/bin/dvdisaster-uninstall.sh"
- install -D -m 644 "${srcdir}/dvdisaster.desktop" \
- "${pkgdir}/usr/share/applications/dvdisaster.desktop"
- install -D -m 644 icons/create.png \
- "${pkgdir}/usr/share/pixmaps/dvdisaster.png"
+ install -D -m 644 contrib/dvdisaster.desktop "${pkgdir}/usr/share/applications/dvdisaster.desktop"
+ for i in 16 24 32 48 64 ; do
+ install -D -m 644 contrib/dvdisaster${i}.png "${pkgdir}/usr/share/icons/hicolor/${i}x${i}/dvdisaster.png"
+ done
}
diff --git a/community/dvdisaster/dvdisaster.desktop b/community/dvdisaster/dvdisaster.desktop
deleted file mode 100644
index 061a53846..000000000
--- a/community/dvdisaster/dvdisaster.desktop
+++ /dev/null
@@ -1,10 +0,0 @@
-[Desktop Entry]
-Encoding=UTF-8
-Exec=dvdisaster
-GenericName=DVD Recovery Tool
-Icon=dvdisaster
-Name=dvdisaster
-StartupNotify=true
-Terminal=false
-Type=Application
-Categories=AudioVideo;GTK;
diff --git a/community/dvdisaster/dvdisaster.install b/community/dvdisaster/dvdisaster.install
new file mode 100644
index 000000000..1a05f573e
--- /dev/null
+++ b/community/dvdisaster/dvdisaster.install
@@ -0,0 +1,11 @@
+post_install() {
+ gtk-update-icon-cache -q -t -f usr/share/icons/hicolor
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ post_install
+}
diff --git a/community/hedgewars/PKGBUILD b/community/hedgewars/PKGBUILD
index 35558eafc..c918a8a8e 100644
--- a/community/hedgewars/PKGBUILD
+++ b/community/hedgewars/PKGBUILD
@@ -1,9 +1,9 @@
-# $Id: PKGBUILD 94887 2013-08-01 06:55:02Z bpiotrowski $
+# $Id: PKGBUILD 97071 2013-09-12 10:11:10Z spupykin $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
pkgname=hedgewars
pkgver=0.9.19
-pkgrel=2
+pkgrel=4
pkgdesc="Free Worms-like turn based strategy game"
arch=('i686' 'x86_64')
url="http://hedgewars.org"
@@ -20,12 +20,10 @@ makedepends=('fpc' 'cmake'
'haskell-vector'
'haskell-random')
source=(http://download.gna.org/hedgewars/hedgewars-src-$pkgver.tar.bz2
- hedgewars.desktop
hedgewars.png
build-fix.patch
ffmpeg2.0.patch)
md5sums=('51d84ad6ea00e9894e6119b118b4a523'
- '48c66a3204d4fa0a69e9aa46f7c31e0c'
'eeb14d50df39063549ac5eca9dbc65d1'
'a9d7b0ba72cbeb7fc74fce459db9dd90'
'da84d64a252579236d3ff0cc6e008e72')
@@ -54,5 +52,5 @@ package() {
install -D -m644 Fonts_LICENSE.txt $pkgdir/usr/share/licenses/$pkgname/Fonts_LICENSE.txt
install -D -m644 $srcdir/hedgewars.png $pkgdir/usr/share/pixmaps/hedgewars.png
- install -D -m644 $srcdir/hedgewars.desktop $pkgdir/usr/share/applications/hedgewars.desktop
+ install -D -m644 share/hedgewars/Data/misc/hedgewars.desktop $pkgdir/usr/share/applications/hedgewars.desktop
}
diff --git a/community/hedgewars/hedgewars.desktop b/community/hedgewars/hedgewars.desktop
deleted file mode 100644
index 9d74ed3f1..000000000
--- a/community/hedgewars/hedgewars.desktop
+++ /dev/null
@@ -1,8 +0,0 @@
-[Desktop Entry]
-Type=Application
-Name=Hedgewars
-GenericName=Platform Game
-Comment=Worms style game
-Exec=hedgewars
-Icon=hedgewars
-Categories=Game;ArcadeGame; \ No newline at end of file
diff --git a/community/ipvsadm/01-fix-not-showing-all-server.patch b/community/ipvsadm/01-fix-not-showing-all-server.patch
deleted file mode 100644
index dea23bf76..000000000
--- a/community/ipvsadm/01-fix-not-showing-all-server.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff -urN ipvsadm-1.26.vanilla/libipvs/ip_vs.h ipvsadm-1.26/libipvs/ip_vs.h
---- ipvsadm-1.26.vanilla/libipvs/ip_vs.h 2011-02-06 18:38:57.000000000 -0800
-+++ ipvsadm-1.26/libipvs/ip_vs.h 2011-08-23 15:03:59.000000000 -0700
-@@ -413,7 +413,7 @@
- __IPVS_CMD_ATTR_MAX,
- };
-
--#define IPVS_CMD_ATTR_MAX (__IPVS_SVC_ATTR_MAX - 1)
-+#define IPVS_CMD_ATTR_MAX (__IPVS_CMD_ATTR_MAX - 1)
-
- /*
- * Attributes used to describe a service
-diff -urN ipvsadm-1.26.vanilla/libipvs/ip_vs_nl_policy.c
-ipvsadm-1.26/libipvs/ip_vs_nl_policy.c
---- ipvsadm-1.26.vanilla/libipvs/ip_vs_nl_policy.c 2008-09-18
-08:57:37.000000000 -0700
-+++ ipvsadm-1.26/libipvs/ip_vs_nl_policy.c 2011-08-23 14:45:34.000000000 -0700
-@@ -26,6 +26,8 @@
- [IPVS_SVC_ATTR_TIMEOUT] = { .type = NLA_U32 },
- [IPVS_SVC_ATTR_NETMASK] = { .type = NLA_U32 },
- [IPVS_SVC_ATTR_STATS] = { .type = NLA_NESTED },
-+ [IPVS_SVC_ATTR_PE_NAME] = { .type = NLA_STRING,
-+ .maxlen = IP_VS_PENAME_MAXLEN},
- };
diff --git a/community/ipvsadm/PKGBUILD b/community/ipvsadm/PKGBUILD
index e34683321..df129e8de 100644
--- a/community/ipvsadm/PKGBUILD
+++ b/community/ipvsadm/PKGBUILD
@@ -1,10 +1,10 @@
-# $Id: PKGBUILD 90518 2013-05-12 23:51:34Z seblu $
+# $Id: PKGBUILD 97090 2013-09-12 12:47:32Z seblu $
# Maintainer: Sébastien Luttringer
# Contributor: Judd Vinet <jvinet@zeroflux.org>
pkgname=ipvsadm
-pkgver=1.26
-pkgrel=8
+pkgver=1.27
+pkgrel=1
pkgdesc='The IP Virtual Server administration utility'
arch=('i686' 'x86_64')
url='http://www.linuxvirtualserver.org/software/ipvs.html'
@@ -13,18 +13,17 @@ depends=('libnl1' 'popt' 'bash')
backup=("etc/$pkgname.conf")
options=('!makeflags')
install=$pkgname.install
-source=("http://www.linuxvirtualserver.org/software/kernel-2.6/$pkgname-$pkgver.tar.gz"
+source=("https://kernel.org/pub/linux/utils/kernel/ipvsadm/$pkgname-$pkgver.tar.xz"
"$pkgname.systemd"
- "$pkgname.service"
- '01-fix-not-showing-all-server.patch')
-md5sums=('eac3ba3f62cd4dea2da353aeddd353a8'
- 'b45ef25d384a7a68b51ff80d0fe81dd2'
- 'dc87684064f85b64c1e79c1eac336303'
- 'e9fb77d2fbe2d3f41d60257316338543')
+ "$pkgname.service")
+# upstream provides sha256sums of release
+sha256sums=('d360fb4dcf591e0a8a918831e2c02b1dc03e3c17ee1e60d0d70de9455238b3f8'
+ '4960ea254128347b03665d51817f29cb643cf2ebca13f5f46649257552ad3ceb'
+ '25506d07f412cccab6f2f3a2a1900d5eeda27bc58602d14f44910c4e036b5341')
-prepare() {
- patch -p1 -d $pkgname-$pkgver < 01-fix-not-showing-all-server.patch
-}
+#prepare() {
+ #patch -p1 -d $pkgname-$pkgver < 01-fix-not-showing-all-server.patch
+#}
build() {
cd $pkgname-$pkgver
diff --git a/community/lxdm/PKGBUILD b/community/lxdm/PKGBUILD
index 1c8043ebc..f0f50a4b6 100644
--- a/community/lxdm/PKGBUILD
+++ b/community/lxdm/PKGBUILD
@@ -1,17 +1,17 @@
-# $Id: PKGBUILD 96932 2013-09-08 22:11:41Z bgyorgy $
+# $Id: PKGBUILD 97058 2013-09-11 23:48:41Z bgyorgy $
# Maintainer: Bartłomiej Piotrowski <nospam@bpiotrowski.pl>
# Contributor: AndyRTR <andyrtr@archlinux.org>
# Contributor: kiefer <jorgelmadrid@gmail.com>
pkgname=lxdm
pkgver=0.4.1
-pkgrel=25
+pkgrel=26
pkgdesc='Lightweight X11 Display Manager'
arch=('i686' 'x86_64')
url="http://sourceforge.net/projects/lxdm/"
license=('GPL')
groups=('lxde')
-depends=('gtk2' 'xorg-server')
+depends=('gtk2' 'xorg-server' 'iso-codes')
makedepends=('git' 'intltool')
optdepends=('gtk-engines: default GTK+ theme'
'librsvg: display the default background')
@@ -23,8 +23,8 @@ source=(http://downloads.sourceforge.net/lxde/$pkgname-$pkgver.tar.gz
git-fixes.patch
default-config.patch)
md5sums=('8da1cfc2be6dc9217c85a7cf51e1e821'
- 'b9e0d1fcf2a3e163446269a5614c2779'
- '3c1aa66182acbbf85f2e0aad03bf133b')
+ '62ca036a270732ee39b11b9ee27ae338'
+ 'c61ec8ffd3fe8bd2a6a9178393622f4c')
prepare(){
cd "$srcdir/$pkgname-$pkgver"
diff --git a/community/lxdm/default-config.patch b/community/lxdm/default-config.patch
index c0a579840..78c9bc00b 100644
--- a/community/lxdm/default-config.patch
+++ b/community/lxdm/default-config.patch
@@ -61,14 +61,13 @@ diff -Naur lxdm.orig/data/Xsession lxdm/data/Xsession
diff -Naur lxdm.orig/pam/lxdm lxdm/pam/lxdm
--- lxdm.orig/pam/lxdm 2013-08-30 17:56:16.100339000 +0200
+++ lxdm/pam/lxdm 2013-08-30 17:58:35.543771605 +0200
-@@ -1,10 +1,7 @@
+@@ -1,9 +1,7 @@
#%PAM-1.0
-auth substack system-auth
-auth optional pam_gnome_keyring.so
-account include system-auth
-session optional pam_keyinit.so force revoke
-session include system-auth
--session required pam_loginuid.so
-session optional pam_console.so
-session optional pam_gnome_keyring.so auto_start
-session optional pam_selinux.so
diff --git a/community/lxdm/git-fixes.patch b/community/lxdm/git-fixes.patch
index 0f724d0e2..0137378e0 100644
--- a/community/lxdm/git-fixes.patch
+++ b/community/lxdm/git-fixes.patch
@@ -20,7 +20,7 @@ index bfac56b..6f997b8 100644
rpmbuild -bb \
--define "_sourcedir `pwd`" \
diff --git a/configure.ac b/configure.ac
-index e952473..c307de2 100644
+index e952473..8958c9c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,8 +2,8 @@
@@ -29,7 +29,7 @@ index e952473..c307de2 100644
AC_PREREQ([2.63])
-AC_INIT([lxdm], [0.4.1], [http://lxde.org/])
-AM_INIT_AUTOMAKE([-Wall -Werror foreign])
-+AC_INIT([lxdm], [0.4.2], [http://lxde.org/])
++AC_INIT([lxdm], [0.5.0], [http://lxde.org/])
+AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects])
AC_CONFIG_SRCDIR([src/lxdm.c])
@@ -80,6 +80,15 @@ index e952473..c307de2 100644
AC_ARG_ENABLE(password,
AC_HELP_STRING([--enable-password],[enable to load autologin password store at config file]),
+@@ -118,7 +136,7 @@ if test "x$enable_debug" = "x$yes" ; then
+ fi
+
+ AC_ARG_WITH(xconn,
+- [AC_HELP_STRING([-with-xconn=@<:@xlib/xcb@:>@],[use xlib or xcb to use])],
++ [AC_HELP_STRING([--with-xconn=@<:@xlib/xcb@:>@],[use xlib or xcb to use])],
+ [if test "x$with_xconn" = "xxlib"; then
+ PKG_CHECK_MODULES(XCONN,"x11")
+ AC_SUBST(XCONN_CFLAGS)
@@ -138,6 +156,14 @@ AC_ARG_WITH(xconn,
]
)
@@ -669,28 +678,43 @@ index ae5b345..3033d74 100644
%changelog
diff --git a/pam/lxdm b/pam/lxdm
-index 51ffda4..cffd07b 100644
+index 51ffda4..41c95f4 100644
--- a/pam/lxdm
+++ b/pam/lxdm
-@@ -7,3 +7,4 @@ session include system-auth
- session required pam_loginuid.so
+@@ -4,6 +4,6 @@ auth optional pam_gnome_keyring.so
+ account include system-auth
+ session optional pam_keyinit.so force revoke
+ session include system-auth
+-session required pam_loginuid.so
session optional pam_console.so
session optional pam_gnome_keyring.so auto_start
+session optional pam_selinux.so
diff --git a/src/Makefile.am b/src/Makefile.am
-index 7fdfd99..ebfa29c 100644
+index 7fdfd99..4f9a11c 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
-@@ -20,7 +20,7 @@ lxdm_binary_LDADD = \
+@@ -8,6 +8,7 @@ lxdm_binary_CFLAGS = \
+ -DXSESSIONS_DIR=\"@datarootdir@/xsessions\" \
+ -DLXDM_DATA_DIR=@datadir@/@PACKAGE@ \
+ -DLXDM_NUMLOCK_PATH=\"@libexecdir@/lxdm-numlock\" \
++ -DLXDM_SESSION_PATH=\"@libexecdir@/lxdm-session\" \
+ $(CONSOLEKIT_CFLAGS) \
+ -Werror-implicit-function-declaration \
+ -Wall \
+@@ -20,10 +21,10 @@ lxdm_binary_LDADD = \
$(NULL)
lxdm_binary_SOURCES = \
- lxdm.c lxdm.h ui.c lxcom.c lxcom.h xconn.c xconn.h \
-+ lxdm.c lxdm.h ui.c lxcom.c lxcom.h xconn.c xconn.h lxcommon.h \
++ lxdm.c lxdm.h ui.c lxcom.c lxcom.h xconn.c xconn.h auth.c lxcommon.h \
$(NULL)
- libexec_PROGRAMS = lxdm-greeter-gdk lxdm-numlock lxdm-greeter-gtk
-@@ -49,6 +49,7 @@ lxdm_greeter_gtk_SOURCES = \
+-libexec_PROGRAMS = lxdm-greeter-gdk lxdm-numlock lxdm-greeter-gtk
++libexec_PROGRAMS = lxdm-greeter-gdk lxdm-numlock lxdm-greeter-gtk lxdm-session
+
+ lxdm_greeter_gtk_CFLAGS = \
+ $(GTK_CFLAGS) \
+@@ -49,6 +50,7 @@ lxdm_greeter_gtk_SOURCES = \
gdm/locarchive.h \
lxcom.c lxcom.h \
greeter-utils.c greeter-utils.h \
@@ -698,6 +722,718 @@ index 7fdfd99..ebfa29c 100644
$(NULL)
lxdm_greeter_gdk_CFLAGS = \
+@@ -84,6 +86,18 @@ lxdm_numlock_LDADD = \
+ $(XLIB_LIBS) \
+ $(NULL)
+
++lxdm_session_SOURCES = \
++ pam.c \
++ $(NULL)
++
++lxdm_session_CFLAGS = \
++ $(GLIB_CFLAGS) \
++ $(NULL)
++
++lxdm_session_LDFLAGS = \
++ $(GLIB_LIBS) \
++ $(NULL)
++
+ bin_PROGRAMS = lxdm-config
+
+ lxdm_config_CFLAGS = \
+@@ -100,3 +114,4 @@ lxdm_config_SOURCES = \
+ config.c \
+ $(NULL)
+
++
+diff --git a/src/auth.c b/src/auth.c
+new file mode 100644
+index 0000000..10c047c
+--- /dev/null
++++ b/src/auth.c
+@@ -0,0 +1,632 @@
++/*
++ * lxdm.c - main entry of lxdm
++ *
++ * Copyright 2009 dgod <dgod.osa@gmail.com>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 3 of the License, or
++ * (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
++ * MA 02110-1301, USA.
++ */
++
++#define _GNU_SOURCE
++
++#ifdef HAVE_CONFIG_H
++#include <config.h>
++#endif
++#ifndef HAVE_LIBPAM
++#ifdef USE_PAM
++#define HAVE_LIBPAM 1
++#else
++#define HAVE_LIBPAM 0
++#endif
++#endif
++
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++#include <stdarg.h>
++
++#include <pwd.h>
++#include <grp.h>
++#include <shadow.h>
++#include <unistd.h>
++#include <errno.h>
++
++#include <glib.h>
++
++#include "lxdm.h"
++#include "auth.h"
++
++#if HAVE_LIBPAM
++
++#define PAM_MP 1
++
++#endif
++
++void switch_user(struct passwd *pw, const char *run, char **env);
++
++static void passwd_clean(struct passwd *pw)
++{
++ g_free(pw->pw_name);
++ g_free(pw->pw_gecos);
++ g_free(pw->pw_dir);
++ g_free(pw->pw_shell);
++ memset(pw,0,sizeof(*pw));
++}
++
++#if !PAM_MP
++static void passwd_copy(struct passwd *dst,struct passwd *src)
++{
++ dst->pw_name=g_strdup(src->pw_name);
++ dst->pw_uid=src->pw_uid;
++ dst->pw_gid=src->pw_gid;
++ if(src->pw_gecos)
++ dst->pw_gecos=g_strdup(src->pw_gecos);
++ dst->pw_dir=g_strdup(src->pw_dir);
++ dst->pw_shell=g_strdup(src->pw_shell);
++}
++#endif
++
++#if !HAVE_LIBPAM
++
++
++int lxdm_auth_init(LXDM_AUTH *a)
++{
++ memset(a,0m,sizeof(*a));
++ return 0;
++}
++
++int lxdm_auth_cleanup(LXDM_AUTH *a)
++{
++ passwd_clean(&a->pw);
++ return 0;
++}
++
++int lxdm_auth_user_authenticate(LXDM_AUTH *a,const char *user,const char *pass,int type)
++{
++ struct passwd *pw;
++ struct spwd *sp;
++ char *real;
++ char *enc;
++ if(!user || !user[0])
++ {
++ g_debug("user==NULL\n");
++ return AUTH_ERROR;
++ }
++ pw = getpwnam(user);
++ endpwent();
++ if(!pw)
++ {
++ g_debug("user %s not found\n",user);
++ return AUTH_BAD_USER;
++ }
++ if(strstr(pw->pw_shell, "nologin"))
++ {
++ g_debug("user %s have nologin shell\n",user);
++ return AUTH_PRIV;
++ }
++ if(type==AUTH_TYPE_AUTO_LOGIN && !pass)
++ {
++ goto out;
++ }
++ sp = getspnam(user);
++ if( !sp )
++ {
++ return AUTH_FAIL;
++ }
++ endspent();
++ real = sp->sp_pwdp;
++ if( !real || !real[0] )
++ {
++ if( !pass || !pass[0] )
++ {
++ *ppw = pw;
++ g_debug("user %s auth with no password ok\n",user);
++ return AUTH_SUCCESS;
++ }
++ else
++ {
++ g_debug("user %s password not match\n",user);
++ return AUTH_FAIL;
++ }
++ }
++ enc = crypt(pass, real);
++ if( strcmp(real, enc) )
++ {
++ g_debug("user %s password not match\n",user);
++ return AUTH_FAIL;
++ }
++out:
++ g_debug("user %s auth ok\n",pw->pw_name);
++ passwd_copy(&a->pw,pw);
++ return AUTH_SUCCESS;
++}
++
++int lxdm_auth_session_begin(LXDM_AUTH *a,int tty,int display,char mcookie[16])
++{
++ return 0;
++}
++
++int lxdm_auth_session_end(LXDM_AUTH *a)
++{
++ return 0;
++}
++
++int lxdm_auth_clean_for_child(LXDM_AUTH *a)
++{
++ return 0;
++}
++
++char **lxdm_auth_append_env(LXDM_AUTH *a,char **env)
++{
++ return env;
++}
++
++int lxdm_auth_session_run(LXDM_AUTH *a,const char *session_exec,char **env)
++{
++ int pid;
++ pid = fork();
++ if(pid==0)
++ {
++ env=lxdm_auth_append_env(a,env);
++ lxdm_auth_clean_for_child(a);
++ switch_user(&a->pw, session_exec, env);
++ lxdm_quit_self(4);
++ }
++ return pid;
++}
++
++#elif !PAM_MP
++
++#include <security/pam_appl.h>
++
++static char *user_pass[2];
++
++static int do_conv(int num, const struct pam_message **msg,struct pam_response **resp, void *arg)
++{
++ int result = PAM_SUCCESS;
++ int i;
++ *resp = (struct pam_response *) calloc(num, sizeof(struct pam_response));
++ for(i=0;i<num;i++)
++ {
++ //printf("MSG: %d %s\n",msg[i]->msg_style,msg[i]->msg);
++ switch(msg[i]->msg_style){
++ case PAM_PROMPT_ECHO_ON:
++ resp[i]->resp=strdup(user_pass[0]?user_pass[0]:"");
++ break;
++ case PAM_PROMPT_ECHO_OFF:
++ //resp[i]->resp=strdup(user_pass[1]?user_pass[1]:"");
++ resp[i]->resp=user_pass[1]?strdup(user_pass[1]):NULL;
++ break;
++ case PAM_ERROR_MSG:
++ case PAM_TEXT_INFO:
++ //printf("PAM: %s\n",msg[i]->msg);
++ break;
++ default:
++ break;
++ }
++ }
++ return result;
++}
++
++static struct pam_conv conv={.conv=do_conv,.appdata_ptr=user_pass};
++
++int lxdm_auth_init(LXDM_AUTH *a)
++{
++ memset(a,0,sizeof(*a));
++ return 0;
++}
++
++int lxdm_auth_cleanup(LXDM_AUTH *a)
++{
++ passwd_clean(&a->pw);
++ return 0;
++}
++
++int lxdm_auth_user_authenticate(LXDM_AUTH *a,const char *user,const char *pass,int type)
++{
++ struct passwd *pw;
++ if(!user || !user[0])
++ {
++ g_debug("user==NULL\n");
++ return AUTH_ERROR;
++ }
++ pw = getpwnam(user);
++ endpwent();
++ if(!pw)
++ {
++ g_debug("user %s not found\n",user);
++ return AUTH_BAD_USER;
++ }
++ if(strstr(pw->pw_shell, "nologin"))
++ {
++ g_debug("user %s have nologin shell\n",user);
++ return AUTH_PRIV;
++ }
++ if(a->handle) pam_end(a->handle,0);
++ if(PAM_SUCCESS != pam_start("lxdm", pw->pw_name, &conv, (pam_handle_t**)&a->handle))
++ {
++ a->handle=NULL;
++ g_debug("user %s start pam fail\n",user);
++ return AUTH_FAIL;
++ }
++ else
++ {
++ int ret;
++ if(type==AUTH_TYPE_AUTO_LOGIN && !pass)
++ goto out;
++ user_pass[0]=(char*)user;user_pass[1]=(char*)pass;
++ ret=pam_authenticate(a->handle,PAM_SILENT);
++ user_pass[0]=0;user_pass[1]=0;
++ if(ret!=PAM_SUCCESS)
++ {
++ g_debug("user %s auth fail with %d\n",user,ret);
++ return AUTH_FAIL;
++ }
++ ret=pam_acct_mgmt(a->handle,PAM_SILENT);
++ if(ret!=PAM_SUCCESS)
++ {
++ g_debug("user %s acct mgmt fail with %d\n",user,ret);
++ return AUTH_FAIL;
++ }
++ }
++out:
++ passwd_copy(&a->pw,pw);
++ return AUTH_SUCCESS;
++}
++
++int lxdm_auth_session_begin(LXDM_AUTH *a,const char *name,int tty,int display,char mcookie[16])
++{
++ int err;
++ char x[256];
++
++ if(!a->handle)
++ {
++ g_message("begin session without auth\n");
++ return -1;
++ }
++ sprintf(x, "tty%d", tty);
++ pam_set_item(a->handle, PAM_TTY, x);
++#ifdef PAM_XDISPLAY
++ sprintf(x,":%d",display);
++ pam_set_item(a->handle, PAM_XDISPLAY, x);
++#endif
++#if !defined(DISABLE_XAUTH) && defined(PAM_XAUTHDATA)
++ struct pam_xauth_data value;
++ value.name="MIT-MAGIC-COOKIE-1";
++ value.namelen=18;
++ value.data=mcookie;
++ value.datalen=16;
++ pam_set_item (a->handle, PAM_XAUTHDATA, &value);
++#endif
++ if(name && name[0])
++ {
++ char *env;
++ env = g_strdup_printf ("DESKTOP_SESSION=%s", name);
++ pam_putenv (a->handle, env);
++ g_free (env);
++ }
++ err = pam_open_session(a->handle, 0); /* FIXME pam session failed */
++ if( err != PAM_SUCCESS )
++ g_warning( "pam open session error \"%s\"\n", pam_strerror(a->handle, err));
++ return 0;
++}
++
++int lxdm_auth_session_end(LXDM_AUTH *a)
++{
++ int err;
++ if(!a->handle)
++ return 0;
++ err = pam_close_session(a->handle, 0);
++ pam_end(a->handle, err);
++ a->handle = NULL;
++ passwd_clean(&a->pw);
++ return 0;
++}
++
++int lxdm_auth_clean_for_child(LXDM_AUTH *a)
++{
++ pam_end(a->handle,0);
++ return 0;
++}
++
++char **lxdm_auth_append_env(LXDM_AUTH *a,char **env)
++{
++ int i,j,n,pa;
++ char **penv;
++ if(!a->handle) return env;
++ penv=pam_getenvlist(a->handle);
++ if(!penv) return env;
++ pa=g_strv_length(penv);
++ if(pa==0)
++ {
++ free(penv);
++ return env;
++ }
++ env=g_renew(char *,env,g_strv_length(env)+1+pa+10);
++ for(i=0;penv[i]!=NULL;i++)
++ {
++ fprintf(stderr,"PAM %s\n",penv[i]);
++ n=strcspn(penv[i],"=")+1;
++ for(j=0;env[j]!=NULL;j++)
++ {
++ if(!strncmp(penv[i],env[j],n))
++ break;
++ if(env[j+1]==NULL)
++ {
++ env[j+1]=g_strdup(penv[i]);
++ env[j+2]=NULL;
++ break;
++ }
++ }
++ free(penv[i]);
++ }
++ free(penv);
++ return env;
++}
++
++int lxdm_auth_session_run(LXDM_AUTH *a,const char *session_exec,char **env)
++{
++ int pid;
++ pid = fork();
++ if(pid==0)
++ {
++ env=lxdm_auth_append_env(a,env);
++ lxdm_auth_clean_for_child(a);
++ switch_user(&a->pw, session_exec, env);
++ lxdm_quit_self(4);
++ }
++ return pid;
++}
++
++#else
++
++static void xwrite(int fd,const void *buf,size_t size)
++{
++ int ret;
++ do{
++ ret=write(fd,buf,size);
++ }while(ret==-1 && errno==EINTR);
++}
++
++static int xreadline(int fd,char *buf,size_t size)
++{
++ int i;
++ for(i=0;i<size-1;i++)
++ {
++ int ret;
++ do{
++ ret=read(fd,buf+i,1);
++ }while(ret==-1 && errno==EINTR);
++ if(buf[i]==-1 || buf[i]=='\n')
++ break;
++ }
++ buf[i]=0;
++ return i;
++}
++
++int lxdm_auth_init(LXDM_AUTH *a)
++{
++ memset(a,0,sizeof(*a));
++ a->pipe[0]=a->pipe[1]=-1;
++ return 0;
++}
++
++int lxdm_auth_cleanup(LXDM_AUTH *a)
++{
++ passwd_clean(&a->pw);
++ if(a->pipe[0]!=-1)
++ {
++ close(a->pipe[0]);
++ a->pipe[0]=-1;
++ }
++ if(a->pipe[1]!=-1)
++ {
++ close(a->pipe[1]);
++ a->pipe[1]=-1;
++ }
++ return 0;
++}
++
++//#undef LXDM_SESSION_PATH
++//#define LXDM_SESSION_PATH "./lxdm-session"
++static int check_child(LXDM_AUTH *a)
++{
++ if(a->pipe[0]!=-1)
++ return 0;
++ char *argv[3]={LXDM_SESSION_PATH,NULL,NULL};
++ GPid pid;
++ gboolean ret;
++ ret = g_spawn_async_with_pipes(NULL, argv, NULL,
++ G_SPAWN_DO_NOT_REAP_CHILD, NULL,NULL,
++ &pid, a->pipe + 0, a->pipe + 1, NULL, NULL);
++ if(ret==FALSE)
++ {
++ g_message("spawn lxdm-auth fail\n");
++ return -1;
++ }
++ a->child=(int)pid;
++ return 0;
++}
++
++int lxdm_auth_user_authenticate(LXDM_AUTH *a,const char *user,const char *pass,int type)
++{
++ char temp[128];
++ char res[8];
++ int ret;
++ if(check_child(a)!=0)
++ {
++ printf("check child fail\n");
++ return -1;
++ }
++ if(type==AUTH_TYPE_AUTO_LOGIN && pass)
++ type=AUTH_TYPE_NORMAL;
++ else if(type==AUTH_TYPE_NORMAL && !pass)
++ type=AUTH_TYPE_NULL_PASS;
++ xwrite(a->pipe[0],"auth\n",5);
++ ret=sprintf(temp,"%d\n",type);
++ xwrite(a->pipe[0],temp,ret);
++ ret=sprintf(temp,"%s\n",user);
++ xwrite(a->pipe[0],temp,ret);
++ if(pass!=NULL)
++ ret=sprintf(temp,"%s\n",pass);
++ xwrite(a->pipe[0],temp,ret);
++ ret=xreadline(a->pipe[1],res,sizeof(res));
++ if(ret<=0)
++ {
++ g_message("read user auth result fail\n");
++ return -1;
++ }
++ ret=atoi(res);
++ if(ret==AUTH_SUCCESS)
++ {
++ passwd_clean(&a->pw);
++ a->pw.pw_name=g_strdup(user);
++ ret=xreadline(a->pipe[1],temp,sizeof(temp));
++ if(ret==-1) return -1;
++ a->pw.pw_uid=atoi(temp);
++ ret=xreadline(a->pipe[1],temp,sizeof(temp));
++ if(ret==-1) return -1;
++ a->pw.pw_gid=atoi(temp);
++ ret=xreadline(a->pipe[1],temp,sizeof(temp));
++ if(ret==-1) return -1;
++ a->pw.pw_gecos=g_strdup(temp);
++ ret=xreadline(a->pipe[1],temp,sizeof(temp));
++ if(ret==-1) return -1;
++ a->pw.pw_dir=g_strdup(temp);
++ ret=xreadline(a->pipe[1],temp,sizeof(temp));
++ if(ret==-1) return -1;
++ a->pw.pw_shell=g_strdup(temp);
++ }
++ return atoi(res);
++}
++#include <assert.h>
++int lxdm_auth_session_begin(LXDM_AUTH *a,const char *name,int tty,int display,char mcookie[16])
++{
++ char temp[32];
++ char res[8];
++ gchar *b64;
++ int ret;
++
++ if(check_child(a)!=0)
++ return -1;
++ xwrite(a->pipe[0],"begin\n",6);
++ ret=sprintf(temp,"%s\n",name?:"");
++ xwrite(a->pipe[0],temp,ret);
++ ret=sprintf(temp,"%d\n",tty);
++ xwrite(a->pipe[0],temp,ret);
++ ret=sprintf(temp,"%d\n",display);
++ xwrite(a->pipe[0],temp,ret);
++ b64=g_base64_encode((const guchar*)mcookie,16);
++ assert(b64!=NULL);
++ ret=sprintf(temp,"%s\n",b64);
++ g_free(b64);
++ xwrite(a->pipe[0],temp,ret);
++ ret=xreadline(a->pipe[1],res,sizeof(res));
++ if(ret<=0)
++ {
++ g_message("pam session begin fail\n");
++ return -1;
++ }
++ ret=atoi(res);
++ return ret;
++}
++
++int lxdm_auth_session_end(LXDM_AUTH *a)
++{
++ passwd_clean(&a->pw);
++ if(a->pipe[0]!=-1)
++ {
++ xwrite(a->pipe[0],"exit\n",5);
++ close(a->pipe[0]);
++ a->pipe[0]=-1;
++ }
++ if(a->pipe[1]!=-1)
++ {
++ close(a->pipe[1]);
++ a->pipe[1]=-1;
++ }
++ return 0;
++}
++
++int lxdm_auth_clean_for_child(LXDM_AUTH *a)
++{
++ return 0;
++}
++
++char **lxdm_auth_append_env(LXDM_AUTH *a,char **env)
++{
++ int i,j,n,pa;
++ char temp[1024];
++ int ret;
++ char **penv;
++
++ if(check_child(a)!=0)
++ return env;
++ xwrite(a->pipe[0],"env\n",4);
++ ret=xreadline(a->pipe[1],temp,sizeof(temp));
++ if(ret<=0) return env;
++ penv=g_strsplit(temp," ",-1);
++ pa=g_strv_length(penv);
++ if(pa==0)
++ {
++ g_strfreev(penv);
++ return env;
++ }
++ env=g_renew(char *,env,g_strv_length(env)+1+pa+10);
++ for(i=0;penv[i]!=NULL;i++)
++ {
++ g_debug("PAM %s\n",penv[i]);
++ n=strcspn(penv[i],"=")+1;
++ for(j=0;env[j]!=NULL;j++)
++ {
++ if(!strncmp(penv[i],env[j],n))
++ break;
++ if(env[j+1]==NULL)
++ {
++ env[j+1]=g_strdup(penv[i]);
++ env[j+2]=NULL;
++ break;
++ }
++ }
++ }
++ g_strfreev(penv);
++ return env;
++}
++
++int lxdm_auth_session_run(LXDM_AUTH *a,const char *session_exec,char **env)
++{
++ int fd;
++ if(check_child(a)!=0)
++ return -1;
++ fd=a->pipe[0];
++ if(env!=NULL)
++ {
++ int i;
++ xwrite(fd,"putenv\n",7);
++ for(i=0;env[i]!=NULL;i++)
++ {
++ xwrite(fd,env[i],strlen(env[i]));
++ xwrite(fd,"\n",1);
++ }
++ xwrite(a->pipe[0],"\n",1);
++ }
++ xwrite(fd,"exec\n",5);
++ xwrite(fd,session_exec,strlen(session_exec));
++ xwrite(fd,"\n",1);
++ return a->child;
++}
++
++#endif
++
+diff --git a/src/auth.h b/src/auth.h
+new file mode 100644
+index 0000000..84d2267
+--- /dev/null
++++ b/src/auth.h
+@@ -0,0 +1,44 @@
++/*
++ * lxdm.c - main entry of lxdm
++ *
++ * Copyright 2009 dgod <dgod.osa@gmail.com>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 3 of the License, or
++ * (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
++ * MA 02110-1301, USA.
++ */
++
++#pragma once
++
++typedef struct{
++ void *handle;
++ struct passwd pw;
++ int pipe[2];
++ int child;
++}LXDM_AUTH;
++
++enum{
++ AUTH_TYPE_NORMAL=0,
++ AUTH_TYPE_AUTO_LOGIN,
++ AUTH_TYPE_NULL_PASS
++};
++
++int lxdm_auth_init(LXDM_AUTH *a);
++int lxdm_auth_cleanup(LXDM_AUTH *a);
++int lxdm_auth_user_authenticate(LXDM_AUTH *a,const char *user,const char *pass,int type);
++int lxdm_auth_session_begin(LXDM_AUTH *a,const char *name,int tty,int display,char mcookie[16]);
++int lxdm_auth_session_end(LXDM_AUTH *a);
++int lxdm_auth_clean_for_child(LXDM_AUTH *a);
++char **lxdm_auth_append_env(LXDM_AUTH *a,char **env);
++int lxdm_auth_session_run(LXDM_AUTH *a,const char *session_exec,char **env);
diff --git a/src/config.c b/src/config.c
index 3f92f7b..bee826d 100644
--- a/src/config.c
@@ -1456,30 +2192,62 @@ index 0000000..24a6c38
+#endif /*_LXCOMMON_H_*/
+
diff --git a/src/lxdm.c b/src/lxdm.c
-index 5c279af..ff06389 100644
+index 5c279af..85ef3be 100644
--- a/src/lxdm.c
+++ b/src/lxdm.c
-@@ -25,8 +25,12 @@
+@@ -24,9 +24,6 @@
+ #ifdef HAVE_CONFIG_H
#include <config.h>
#endif
- #ifndef HAVE_LIBPAM
+-#ifndef HAVE_LIBPAM
+-#define HAVE_LIBPAM 0
+-#endif
+
+ #include <stdio.h>
+ #include <stdlib.h>
+@@ -58,17 +55,27 @@
+ #include <utmpx.h>
+ #endif
+
+-#if HAVE_LIBPAM
+-#include <security/pam_appl.h>
+-#endif
+-
+ #if HAVE_LIBCK_CONNECTOR
+ #include <ck-connector.h>
+ #endif
+
++#ifndef HAVE_LIBPAM
+#ifdef USE_PAM
+#define HAVE_LIBPAM 1
+#else
- #define HAVE_LIBPAM 0
- #endif
++#define HAVE_LIBPAM 0
+#endif
-
- #include <stdio.h>
- #include <stdlib.h>
-@@ -69,6 +73,7 @@
++#endif
++
++#if HAVE_LIBPAM
++#include <security/pam_appl.h>
++#endif
++
#include "lxdm.h"
#include "lxcom.h"
#include "xconn.h"
+#include "lxcommon.h"
++#include "auth.h"
#define LOGFILE "/var/log/lxdm.log"
+@@ -82,9 +89,7 @@ typedef struct{
+ int display;
+ char *option; /* hold option in config file */
+ xconn_t dpy; /* hold this, or X crack */
+-#if HAVE_LIBPAM
+- pam_handle_t *pamh;
+-#endif
++ LXDM_AUTH auth;
+ #if HAVE_LIBCK_CONNECTOR
+ CkConnector *ckc;
+ #endif
@@ -96,6 +101,7 @@ typedef struct{
GKeyFile *config;
@@ -1488,38 +2256,26 @@ index 5c279af..ff06389 100644
static GSList *session_list;
static void lxdm_startx(LXSession *s);
-@@ -154,6 +160,30 @@ void stop_pid(int pid)
+@@ -153,18 +159,6 @@ void stop_pid(int pid)
+ while( waitpid(-1, 0, WNOHANG) > 0 ) ;
}
- #if HAVE_LIBPAM
-+
-+// just hack to work with some bad pam module
-+static guint first_pam_source=2;
-+static gboolean clean_pam_func(void)
-+{
-+ return FALSE;
-+}
-+static void clean_pam_glib_source_prepare(pam_handle_t *pamh)
-+{
-+ if(pamh) return;
-+ first_pam_source=g_idle_add((GSourceFunc)clean_pam_func,NULL);
-+}
-+static void clean_pam_glib_source_run(void)
-+{
-+ int i,end=first_pam_source+256;
-+ for(i=first_pam_source;i<end;i++)
-+ {
-+ if(g_source_remove(i)==TRUE)
-+ {
-+ first_pam_source=i+1;
-+ }
-+ }
-+}
-+
- static void close_pam_session(pam_handle_t *pamh)
+-#if HAVE_LIBPAM
+-static void close_pam_session(pam_handle_t *pamh)
+-{
+- int err;
+- if( !pamh ) return;
+- err = pam_close_session(pamh, 0);
+- //err=pam_setcred(pamh, PAM_DELETE_CRED);
+- pam_end(pamh, err);
+- pamh = NULL;
+-}
+-#endif
+-
+ static LXSession *lxsession_find_greeter(void)
{
- int err;
-@@ -271,7 +301,7 @@ static int lxsession_alloc_tty(void)
+ GSList *p;
+@@ -271,7 +265,7 @@ static int lxsession_alloc_tty(void)
static int lxsession_alloc_display(void)
{
int i;
@@ -1528,7 +2284,27 @@ index 5c279af..ff06389 100644
{
if(!display_is_used(i))
return i;
-@@ -467,7 +497,7 @@ static char *lxsession_xserver_command(LXSession *s)
+@@ -299,6 +293,7 @@ static LXSession *lxsession_add(void)
+ return NULL;
+ }
+ s->env=NULL;
++ lxdm_auth_init(&s->auth);
+ session_list=g_slist_prepend(session_list,s);
+ lxdm_startx(s);
+ return s;
+@@ -354,10 +349,7 @@ static void lxsession_stop(LXSession *s)
+ {
+ xconn_clean(s->dpy);
+ }
+-#if HAVE_LIBPAM
+- close_pam_session(s->pamh);
+- s->pamh=NULL;
+-#endif
++ lxdm_auth_session_end(&s->auth);
+ #if HAVE_LIBCK_CONNECTOR
+ if( s->ckc != NULL )
+ {
+@@ -467,7 +459,7 @@ static char *lxsession_xserver_command(LXSession *s)
i++;
}
}
@@ -1537,7 +2313,7 @@ index 5c279af..ff06389 100644
arg = g_renew(char *, arg, arc + 10);
if(nr_tty)
{
-@@ -477,8 +507,11 @@ printf("arc %d\n",arc);
+@@ -477,8 +469,11 @@ printf("arc %d\n",arc);
arg[arc++] = g_strdup_printf(":%d",s->display);
if(s->tty>0)
arg[arc++] = g_strdup_printf("vt%02d", s->tty);
@@ -1551,7 +2327,7 @@ index 5c279af..ff06389 100644
arg[arc] = NULL;
p=g_strjoinv(" ", arg);
g_strfreev(arg);
-@@ -518,15 +551,17 @@ void lxdm_get_tty(void)
+@@ -518,15 +513,17 @@ void lxdm_get_tty(void)
{
nr_tty=1;
}
@@ -1572,7 +2348,14 @@ index 5c279af..ff06389 100644
if(plymouth)
{
nr_tty=1;
-@@ -557,6 +592,7 @@ static void log_init(void)
+@@ -550,13 +547,13 @@ void lxdm_quit_self(int code)
+ static void log_init(void)
+ {
+ int fd_log;
+-
+ g_unlink(LOGFILE ".old");
+ g_rename(LOGFILE, LOGFILE ".old");
+ fd_log = open(LOGFILE, O_CREAT|O_APPEND|O_TRUNC|O_WRONLY|O_EXCL, 0640);
if(fd_log == -1) return;
dup2(fd_log, 1);
dup2(fd_log, 2);
@@ -1580,7 +2363,7 @@ index 5c279af..ff06389 100644
}
static void log_ignore(const gchar *log_domain, GLogLevelFlags log_level,
-@@ -647,6 +683,19 @@ static void replace_env(char** env, const char* name, const char* new_val)
+@@ -647,6 +644,19 @@ static void replace_env(char** env, const char* name, const char* new_val)
*(penv + 1) = NULL;
}
@@ -1600,7 +2383,7 @@ index 5c279af..ff06389 100644
#ifndef DISABLE_XAUTH
static inline void xauth_write_uint16(int fd,uint16_t data)
-@@ -665,15 +714,20 @@ static inline void xauth_write_string(int fd,const char *s)
+@@ -665,15 +675,20 @@ static inline void xauth_write_string(int fd,const char *s)
write(fd,s,len);
}
@@ -1625,7 +2408,7 @@ index 5c279af..ff06389 100644
xauth_write_string(fd,"MIT-MAGIC-COOKIE-1");
xauth_write_uint16(fd,16);
write(fd,data,16);
-@@ -695,9 +749,9 @@ static void create_server_auth(LXSession *s)
+@@ -695,139 +710,55 @@ static void create_server_auth(LXSession *s)
authfile = g_strdup_printf("/var/run/lxdm/lxdm-:%d.auth",s->display);
@@ -1637,17 +2420,20 @@ index 5c279af..ff06389 100644
g_free(authfile);
}
-@@ -706,27 +760,35 @@ static void create_client_auth(char *home,char **env)
+-static void create_client_auth(char *home,char **env)
++static void create_client_auth(struct passwd *pw,char **env)
+ {
LXSession *s;
char *authfile;
- uid_t user;
+- uid_t user;
- char *path;
- if((user=getuid())== 0 ) /* root don't need it */
-+ if((user=getuid())==0) /* root don't need it */
++ if(pw->pw_uid==0) /* root don't need it */
return;
- s=lxsession_find_user(user);
+- s=lxsession_find_user(user);
++ s=lxsession_find_user(pw->pw_uid);
if(!s)
return;
-
@@ -1668,130 +2454,227 @@ index 5c279af..ff06389 100644
+ path=g_key_file_get_string(config,"base","xauth_path",NULL);
+ if(path)
+ {
-+ authfile = g_strdup_printf("%s/.Xauth%d", path,user);
++ authfile = g_strdup_printf("%s/.Xauth%d", path,pw->pw_uid);
+ g_free(path);
+ }
+ else
+ {
-+ authfile = g_strdup_printf("%s/.Xauthority", home);
++ authfile = g_strdup_printf("%s/.Xauthority", pw->pw_dir);
+ }
}
remove(authfile);
- xauth_write_file(authfile,s->mcookie);
+ xauth_write_file(authfile,s->display,s->mcookie);
replace_env(env,"XAUTHORITY=",authfile);
++ chown(authfile,pw->pw_uid,pw->pw_gid);
g_free(authfile);
}
-@@ -748,7 +810,8 @@ static int do_conv(int num, const struct pam_message **msg,struct pam_response *
- resp[i]->resp=strdup(user_pass[0]?user_pass[0]:"");
- break;
- case PAM_PROMPT_ECHO_OFF:
-- resp[i]->resp=strdup(user_pass[1]?user_pass[1]:"");
-+ //resp[i]->resp=strdup(user_pass[1]?user_pass[1]:"");
-+ resp[i]->resp=user_pass[1]?strdup(user_pass[1]):NULL;
- break;
- case PAM_ERROR_MSG:
- case PAM_TEXT_INFO:
-@@ -762,6 +825,7 @@ static int do_conv(int num, const struct pam_message **msg,struct pam_response *
- }
-
- static struct pam_conv conv={.conv=do_conv,.appdata_ptr=user_pass};
-+
#endif
- int lxdm_auth_user(char *user, char *pass, struct passwd **ppw)
-@@ -789,7 +853,7 @@ int lxdm_auth_user(char *user, char *pass, struct passwd **ppw)
- g_debug("user %s not found\n",user);
- return AUTH_BAD_USER;
- }
+-#if HAVE_LIBPAM
+-static char *user_pass[2];
+-
+-static int do_conv(int num, const struct pam_message **msg,struct pam_response **resp, void *arg)
+-{
+- int result = PAM_SUCCESS;
+- int i;
+- *resp = (struct pam_response *) calloc(num, sizeof(struct pam_response));
+- for(i=0;i<num;i++)
+- {
+- //printf("MSG: %d %s\n",msg[i]->msg_style,msg[i]->msg);
+- switch(msg[i]->msg_style){
+- case PAM_PROMPT_ECHO_ON:
+- resp[i]->resp=strdup(user_pass[0]?user_pass[0]:"");
+- break;
+- case PAM_PROMPT_ECHO_OFF:
+- resp[i]->resp=strdup(user_pass[1]?user_pass[1]:"");
+- break;
+- case PAM_ERROR_MSG:
+- case PAM_TEXT_INFO:
+- //printf("PAM: %s\n",msg[i]->msg);
+- break;
+- default:
+- break;
+- }
+- }
+- return result;
+-}
+-
+-static struct pam_conv conv={.conv=do_conv,.appdata_ptr=user_pass};
+-#endif
+-
+-int lxdm_auth_user(char *user, char *pass, struct passwd **ppw)
++int lxdm_auth_user(int type,char *user, char *pass, struct passwd **ppw)
+ {
+- struct passwd *pw;
+-#if !HAVE_LIBPAM
+- struct spwd *sp;
+- char *real;
+- char *enc;
+-#endif
+- if( !user )
+- {
+- g_debug("user==NULL\n");
+- return AUTH_ERROR;
+- }
+- if( !user[0] )
+- {
+- g_debug("user[0]==0\n");
+- return AUTH_BAD_USER;
+- }
+- pw = getpwnam(user);
+- endpwent();
+- if( !pw )
+- {
+- g_debug("user %s not found\n",user);
+- return AUTH_BAD_USER;
+- }
- if( !pass )
-+ if( !pass && !g_key_file_get_integer(config,"base","skip_password",NULL))
- {
- *ppw = pw;
- g_debug("user %s auth ok\n",user);
-@@ -808,7 +872,7 @@ int lxdm_auth_user(char *user, char *pass, struct passwd **ppw)
- real = sp->sp_pwdp;
- if( !real || !real[0] )
- {
+- {
+- *ppw = pw;
+- g_debug("user %s auth ok\n",user);
+- return AUTH_SUCCESS;
+- }
+- if(strstr(pw->pw_shell, "nologin"))
+- {
+- g_debug("user %s have nologin shell\n",user);
+- return AUTH_PRIV;
+- }
+-#if !HAVE_LIBPAM
+- sp = getspnam(user);
+- if( !sp )
+- return AUTH_FAIL;
+- endspent();
+- real = sp->sp_pwdp;
+- if( !real || !real[0] )
+- {
- if( !pass[0] )
-+ if( !pass || !pass[0] )
- {
- *ppw = pw;
- g_debug("user %s auth with no password ok\n",user);
-@@ -837,6 +901,7 @@ int lxdm_auth_user(char *user, char *pass, struct passwd **ppw)
+- {
+- *ppw = pw;
+- g_debug("user %s auth with no password ok\n",user);
+- return AUTH_SUCCESS;
+- }
+- else
+- {
+- g_debug("user %s password not match\n",user);
+- return AUTH_FAIL;
+- }
+- }
+- enc = crypt(pass, real);
+- if( strcmp(real, enc) )
+- {
+- g_debug("user %s password not match\n",user);
+- return AUTH_FAIL;
+- }
+-#else
+ LXSession *s;
++ int ret;
+ s=lxsession_find_greeter();
+ if(!s) s=lxsession_find_idle();
+ if(!s) s=lxsession_add();
+@@ -836,97 +767,12 @@ int lxdm_auth_user(char *user, char *pass, struct passwd **ppw)
+ g_critical("lxsession_add fail\n");
exit(0);
}
- if(s->pamh) pam_end(s->pamh,0);
-+ clean_pam_glib_source_prepare(NULL);
- if(PAM_SUCCESS != pam_start("lxdm", pw->pw_name, &conv, &s->pamh))
- {
- s->pamh=NULL;
-@@ -874,6 +939,7 @@ void setup_pam_session(LXSession *s,struct passwd *pw,char *session_name)
- int err;
- char x[256];
-
-+ clean_pam_glib_source_prepare(s->pamh);
- if(!s->pamh && PAM_SUCCESS != pam_start("lxdm", pw->pw_name, &conv, &s->pamh))
- {
- s->pamh = NULL;
-@@ -886,6 +952,15 @@ void setup_pam_session(LXSession *s,struct passwd *pw,char *session_name)
- pam_set_item(s->pamh, PAM_XDISPLAY, getenv("DISPLAY") );
- #endif
-
-+#if !defined(DISABLE_XAUTH) && defined(PAM_XAUTHDATA)
-+ struct pam_xauth_data value;
-+ value.name="MIT-MAGIC-COOKIE-1";
-+ value.namelen=18;
-+ value.data=s->mcookie;
-+ value.datalen=sizeof(s->mcookie);
-+ pam_set_item (s->pamh, PAM_XAUTHDATA, &value);
-+#endif
-+
- if(session_name && session_name[0])
- {
- char *env;
-@@ -896,18 +971,27 @@ void setup_pam_session(LXSession *s,struct passwd *pw,char *session_name)
- err = pam_open_session(s->pamh, 0); /* FIXME pam session failed */
- if( err != PAM_SUCCESS )
- g_warning( "pam open session error \"%s\"\n", pam_strerror(s->pamh, err));
-+
-+ clean_pam_glib_source_run();
- }
-
+- if(s->pamh) pam_end(s->pamh,0);
+- if(PAM_SUCCESS != pam_start("lxdm", pw->pw_name, &conv, &s->pamh))
+- {
+- s->pamh=NULL;
+- g_debug("user %s start pam fail\n",user);
+- return AUTH_FAIL;
+- }
+- else
+- {
+- int ret;
+- user_pass[0]=user;user_pass[1]=pass;
+- ret=pam_authenticate(s->pamh,PAM_SILENT);
+- user_pass[0]=0;user_pass[1]=0;
+- if(ret!=PAM_SUCCESS)
+- {
+- g_debug("user %s auth fail with %d\n",user,ret);
+- return AUTH_FAIL;
+- }
+- ret=pam_acct_mgmt(s->pamh,PAM_SILENT);
+- if(ret!=PAM_SUCCESS)
+- {
+- g_debug("user %s acct mgmt fail with %d\n",user,ret);
+- return AUTH_FAIL;
+- }
+- //ret=pam_setcred(s->pamh, PAM_ESTABLISH_CRED);
+- }
+-#endif
+- *ppw = pw;
+- g_debug("user %s auth ok\n",pw->pw_name);
+- return AUTH_SUCCESS;
+-}
+-
+-#if HAVE_LIBPAM
+-void setup_pam_session(LXSession *s,struct passwd *pw,char *session_name)
+-{
+- int err;
+- char x[256];
+-
+- if(!s->pamh && PAM_SUCCESS != pam_start("lxdm", pw->pw_name, &conv, &s->pamh))
+- {
+- s->pamh = NULL;
+- return;
+- }
+- if(!s->pamh) return;
+- sprintf(x, "tty%d", s->tty);
+- pam_set_item(s->pamh, PAM_TTY, x);
+-#ifdef PAM_XDISPLAY
+- pam_set_item(s->pamh, PAM_XDISPLAY, getenv("DISPLAY") );
+-#endif
+-
+- if(session_name && session_name[0])
+- {
+- char *env;
+- env = g_strdup_printf ("DESKTOP_SESSION=%s", session_name);
+- pam_putenv (s->pamh, env);
+- g_free (env);
+- }
+- err = pam_open_session(s->pamh, 0); /* FIXME pam session failed */
+- if( err != PAM_SUCCESS )
+- g_warning( "pam open session error \"%s\"\n", pam_strerror(s->pamh, err));
+-}
+-
-void append_pam_environ(pam_handle_t *pamh,char **env)
-+static char **append_pam_environ(pam_handle_t *pamh,char **env)
- {
+-{
- int i,j,n;
-+ int i,j,n,a;
- char **penv;
+- char **penv;
- if(!pamh) return;
-+ if(!pamh) return env;
- penv=pam_getenvlist(pamh);
+- penv=pam_getenvlist(pamh);
- if(!penv) return;
-+ if(!penv) return env;
-+ a=g_strv_length(penv);
-+ if(a==0)
-+ {
-+ free(penv);
-+ return env;
-+ }
-+ env=g_renew(char *,env,g_strv_length(env)+1+a+10);
- for(i=0;penv[i]!=NULL;i++)
- {
+- for(i=0;penv[i]!=NULL;i++)
+- {
- //printf("PAM %s\n",penv[i]);
-+ fprintf(stderr,"PAM %s\n",penv[i]);
- n=strcspn(penv[i],"=")+1;
- for(j=0;env[j]!=NULL;j++)
- {
-@@ -923,6 +1007,7 @@ void append_pam_environ(pam_handle_t *pamh,char **env)
- free(penv[i]);
- }
- free(penv);
-+ return env;
+- n=strcspn(penv[i],"=")+1;
+- for(j=0;env[j]!=NULL;j++)
+- {
+- if(!strncmp(penv[i],env[j],n))
+- break;
+- if(env[j+1]==NULL)
+- {
+- env[j+1]=g_strdup(penv[i]);
+- env[j+2]=NULL;
+- break;
+- }
+- }
+- free(penv[i]);
+- }
+- free(penv);
++ ret=lxdm_auth_user_authenticate(&s->auth,user,pass,type);
++ if(ret==AUTH_SUCCESS)
++ *ppw=&s->auth.pw;
++ return ret;
}
- #endif
-@@ -945,6 +1030,12 @@ static void close_left_fds(void)
+-#endif
+-
+ static void close_left_fds(void)
+ {
+ struct dirent **list;
+@@ -945,9 +791,15 @@ static void close_left_fds(void)
close(fd);
}
free(list);
@@ -1803,8 +2686,39 @@ index 5c279af..ff06389 100644
+ close(fd);
}
- void switch_user(struct passwd *pw, char *run, char **env)
-@@ -1200,6 +1291,11 @@ static void on_session_stop(void *data,int pid, int status)
+-void switch_user(struct passwd *pw, char *run, char **env)
++void switch_user(struct passwd *pw, const char *run, char **env)
+ {
+ int fd;
+
+@@ -968,9 +820,6 @@ void switch_user(struct passwd *pw, char *run, char **env)
+ dup2(fd,STDERR_FILENO);
+ close(fd);
+ }
+-#ifndef DISABLE_XAUTH
+- create_client_auth(pw->pw_dir,env);
+-#endif
+
+ /* reset signal */
+ signal(SIGCHLD, SIG_DFL);
+@@ -1114,7 +963,7 @@ void lxdm_startx(LXSession *s)
+ g_strfreev(args);
+ lxcom_add_child_watch(s->server, on_xserver_stop, s);
+
+- g_message("add xserver watch\n");
++ g_message("%ld: add xserver watch\n",time(NULL));
+ for( i = 0; i < 100; i++ )
+ {
+ if(lxcom_last_sig==SIGINT || lxcom_last_sig==SIGTERM)
+@@ -1124,6 +973,7 @@ void lxdm_startx(LXSession *s)
+ g_usleep(50 * 1000);
+ //g_message("retry %d\n",i);
+ }
++ g_message("%ld: start xserver in %d retry",time(NULL),i);
+ if(s->dpy==NULL)
+ exit(EXIT_FAILURE);
+
+@@ -1200,6 +1050,11 @@ static void on_session_stop(void *data,int pid, int status)
{
lxsession_free(s);
}
@@ -1816,7 +2730,7 @@ index 5c279af..ff06389 100644
gchar *argv[] = { "/etc/lxdm/PostLogout", NULL };
g_spawn_async(NULL, argv, s->env, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, NULL);
}
-@@ -1212,7 +1308,7 @@ gboolean lxdm_get_session_info(char *session,char **pname,char **pexec)
+@@ -1212,7 +1067,7 @@ gboolean lxdm_get_session_info(char *session,char **pname,char **pexec)
name=g_key_file_get_string(config, "base", "session", 0);
if(!name && getenv("PREFERRED"))
name = g_strdup(getenv("PREFERRED"));
@@ -1825,7 +2739,7 @@ index 5c279af..ff06389 100644
name = g_strdup(getenv("DESKTOP"));
if(!name) name=g_strdup("LXDE");
}
-@@ -1291,7 +1387,7 @@ static void lxdm_save_login(char *session,char *lang)
+@@ -1291,7 +1146,7 @@ static void lxdm_save_login(char *session,char *lang)
lang="";
var=g_key_file_new();
g_key_file_set_list_separator(var, ' ');
@@ -1834,7 +2748,7 @@ index 5c279af..ff06389 100644
old=g_key_file_get_string(var,"base","last_session",0);
if(0!=g_strcmp0(old,session))
{
-@@ -1343,7 +1439,7 @@ static void lxdm_save_login(char *session,char *lang)
+@@ -1343,7 +1198,7 @@ static void lxdm_save_login(char *session,char *lang)
char* data = g_key_file_to_data(var, &len, NULL);
mkdir("/var/lib/lxdm",0755);
chmod("/var/lib/lxdm",0755);
@@ -1843,7 +2757,22 @@ index 5c279af..ff06389 100644
g_free(data);
}
g_key_file_free(var);
-@@ -1451,9 +1547,20 @@ void lxdm_do_login(struct passwd *pw, char *session, char *lang, char *option)
+@@ -1423,12 +1278,10 @@ void lxdm_do_login(struct passwd *pw, char *session, char *lang, char *option)
+ s->ckc=NULL;
+ }
+ #endif
+-#if HAVE_LIBPAM
+- setup_pam_session(s,pw,session_name);
+-#endif
++ lxdm_auth_session_begin(&s->auth,session_name,s->tty,s->display,s->mcookie);
+ #if HAVE_LIBCK_CONNECTOR
+ #if HAVE_LIBPAM
+- if(!s->ckc && (!s->pamh || !pam_getenv(s->pamh,"XDG_SESSION_COOKIE")))
++ if(!s->ckc && (!s->auth.handle || !pam_getenv(s->auth.handle,"XDG_SESSION_COOKIE")))
+ #else
+ if(!s->ckc)
+ #endif
+@@ -1451,9 +1304,20 @@ void lxdm_do_login(struct passwd *pw, char *session, char *lang, char *option)
"x11-display", &n,
"is-local",&is_local,
NULL))
@@ -1865,16 +2794,36 @@ index 5c279af..ff06389 100644
char** env, *path;
int n_env,i;
n_env = g_strv_length(environ);
-@@ -1488,7 +1595,7 @@ void lxdm_do_login(struct passwd *pw, char *session, char *lang, char *option)
+@@ -1483,17 +1347,22 @@ void lxdm_do_login(struct passwd *pw, char *session, char *lang, char *option)
+ replace_env(env, "LANGUAGE=", lang);
+ }
+ s->env = env;
++
++#ifndef DISABLE_XAUTH
++ create_client_auth(pw,env);
++#endif
+
+- s->child = pid = fork();
++ /*s->child = pid = fork();
if(s->child==0)
{
- #if HAVE_LIBPAM
+-#if HAVE_LIBPAM
- append_pam_environ(s->pamh,env);
-+ env=append_pam_environ(s->pamh,env);
- pam_end(s->pamh,0);
- #endif
+- pam_end(s->pamh,0);
+-#endif
++ env=lxdm_auth_append_env(&s->auth,env);
++ lxdm_auth_clean_for_child(&s->auth);
switch_user(pw, session_exec, env);
-@@ -1519,7 +1626,7 @@ void lxdm_do_shutdown(void)
+ lxdm_quit_self(4);
+- }
++ }*/
++
++ s->child = pid = lxdm_auth_session_run(&s->auth,session_exec,env);
++
+ g_free(session_name);
+ g_free(session_exec);
+ if(alloc_session)
+@@ -1519,7 +1388,7 @@ void lxdm_do_shutdown(void)
char *cmd;
cmd = g_key_file_get_string(config, "cmd", "shutdown", 0);
if( !cmd ) cmd = g_strdup("shutdown -h now");
@@ -1883,7 +2832,7 @@ index 5c279af..ff06389 100644
g_spawn_command_line_async(cmd,0);
g_free(cmd);
lxdm_quit_self(0);
-@@ -1548,10 +1655,30 @@ int lxdm_do_auto_login(void)
+@@ -1548,10 +1417,30 @@ int lxdm_do_auto_login(void)
if(count==1)
pass = g_key_file_get_string(config, "base", "password", 0);
#endif
@@ -1914,7 +2863,7 @@ index 5c279af..ff06389 100644
if(p[0]=='@')
{
option=p+1;
-@@ -1559,9 +1686,14 @@ int lxdm_do_auto_login(void)
+@@ -1559,11 +1448,16 @@ int lxdm_do_auto_login(void)
session=g_key_file_get_string(config,option,"session",0);
lang=g_key_file_get_string(config,option,"lang",0);
}
@@ -1927,9 +2876,12 @@ index 5c279af..ff06389 100644
+ session=g_strdup(last_session);
+ lang=g_strdup(last_lang);
}
- ret=lxdm_auth_user(user, pass, &pw);
+- ret=lxdm_auth_user(user, pass, &pw);
++ ret=lxdm_auth_user(AUTH_TYPE_AUTO_LOGIN, user, pass, &pw);
if(ret==AUTH_SUCCESS)
-@@ -1571,9 +1703,11 @@ int lxdm_do_auto_login(void)
+ {
+ lxdm_do_login(pw,session,lang,option);
+@@ -1571,9 +1465,11 @@ int lxdm_do_auto_login(void)
}
g_free(user);g_free(session);g_free(lang);
}
@@ -1942,7 +2894,7 @@ index 5c279af..ff06389 100644
}
static void log_sigsegv(void)
-@@ -1677,8 +1811,23 @@ GKeyFile *lxdm_user_list(void)
+@@ -1677,8 +1573,23 @@ GKeyFile *lxdm_user_list(void)
g_key_file_set_comment(kf,NULL,NULL,"lxdm user list",NULL);
while((pw=getpwent())!=NULL)
{
@@ -1966,8 +2918,610 @@ index 5c279af..ff06389 100644
if(strncmp(pw->pw_dir,"/home/",6))
{
if(!strv_find(white,pw->pw_name))
+diff --git a/src/lxdm.h b/src/lxdm.h
+index 4c79ca3..568573f 100644
+--- a/src/lxdm.h
++++ b/src/lxdm.h
+@@ -29,11 +29,12 @@ G_BEGIN_DECLS
+
+ extern GKeyFile *config;
+
+-int lxdm_auth_user(char *user,char *pass,struct passwd **ppw);
++int lxdm_auth_user(int type,char *user,char *pass,struct passwd **ppw);
+ void lxdm_do_login(struct passwd *pw,char *session,char *lang,char *option);
+ void lxdm_do_reboot(void);
+ void lxdm_do_shutdown(void);
+ int lxdm_do_auto_login(void);
++void lxdm_quit_self(int code);
+
+ enum AuthResult
+ {
+diff --git a/src/pam.c b/src/pam.c
+new file mode 100644
+index 0000000..810e44f
+--- /dev/null
++++ b/src/pam.c
+@@ -0,0 +1,578 @@
++/*
++ * lxdm.c - main entry of lxdm
++ *
++ * Copyright 2009 dgod <dgod.osa@gmail.com>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 3 of the License, or
++ * (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
++ * MA 02110-1301, USA.
++ */
++
++#define _GNU_SOURCE
++
++#ifdef HAVE_CONFIG_H
++#include <config.h>
++#endif
++#ifndef HAVE_LIBPAM
++#ifdef USE_PAM
++#define HAVE_LIBPAM 1
++#else
++#define HAVE_LIBPAM 0
++#endif
++#endif
++
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++#include <stdarg.h>
++#include <unistd.h>
++#include <fcntl.h>
++#include <dirent.h>
++#include <errno.h>
++#include <poll.h>
++
++#include <pwd.h>
++#include <grp.h>
++#include <shadow.h>
++
++#include <glib.h>
++
++#include "lxdm.h"
++#include "auth.h"
++
++static void passwd_copy(struct passwd *dst,struct passwd *src)
++{
++ dst->pw_name=g_strdup(src->pw_name);
++ dst->pw_uid=src->pw_uid;
++ dst->pw_gid=src->pw_gid;
++ if(src->pw_gecos)
++ dst->pw_gecos=g_strdup(src->pw_gecos);
++ dst->pw_dir=g_strdup(src->pw_dir);
++ dst->pw_shell=g_strdup(src->pw_shell);
++}
++
++static void passwd_clean(struct passwd *pw)
++{
++ g_free(pw->pw_name);
++ g_free(pw->pw_gecos);
++ g_free(pw->pw_dir);
++ g_free(pw->pw_shell);
++ memset(pw,0,sizeof(*pw));
++}
++
++#if !HAVE_LIBPAM
++
++int lxdm_auth_init(LXDM_AUTH *a)
++{
++ memset(a,0m,sizeof(*a));
++ return 0;
++}
++
++int lxdm_auth_cleanup(LXDM_AUTH *a)
++{
++ passwd_clean(&a->pw);
++ return 0;
++}
++
++int lxdm_auth_user_authenticate(LXDM_AUTH *a,const char *user,const char *pass,int type)
++{
++ struct passwd *pw;
++ struct spwd *sp;
++ char *real;
++ char *enc;
++ if(!user || !user[0])
++ {
++ g_debug("user==NULL\n");
++ return AUTH_ERROR;
++ }
++ pw = getpwnam(user);
++ endpwent();
++ if(!pw)
++ {
++ g_debug("user %s not found\n",user);
++ return AUTH_BAD_USER;
++ }
++ if(strstr(pw->pw_shell, "nologin"))
++ {
++ g_debug("user %s have nologin shell\n",user);
++ return AUTH_PRIV;
++ }
++ if(type==AUTH_TYPE_AUTO_LOGIN && !pass)
++ {
++ goto out;
++ }
++ sp = getspnam(user);
++ if( !sp )
++ {
++ return AUTH_FAIL;
++ }
++ endspent();
++ real = sp->sp_pwdp;
++ if( !real || !real[0] )
++ {
++ if( !pass || !pass[0] )
++ {
++ *ppw = pw;
++ g_debug("user %s auth with no password ok\n",user);
++ return AUTH_SUCCESS;
++ }
++ else
++ {
++ g_debug("user %s password not match\n",user);
++ return AUTH_FAIL;
++ }
++ }
++ enc = crypt(pass, real);
++ if( strcmp(real, enc) )
++ {
++ g_debug("user %s password not match\n",user);
++ return AUTH_FAIL;
++ }
++ g_debug("user %s auth ok\n",pw->pw_name);
++ passwd_copy(&a->pw,pw);
++ return AUTH_SUCCESS;
++}
++
++int lxdm_auth_session_begin(LXDM_AUTH *a,int tty,int display,char mcookie[16])
++{
++ return 0;
++}
++
++int lxdm_auth_session_end(LXDM_AUTH *a)
++{
++ return 0;
++}
++
++int lxdm_auth_clean_for_child(LXDM_AUTH *a)
++{
++ return 0;
++}
++
++void lxdm_auth_print_env(LXDM_AUTH *a)
++{
++}
++
++#else
++
++#include <security/pam_appl.h>
++
++static char *user_pass[2];
++
++static int do_conv(int num, const struct pam_message **msg,struct pam_response **resp, void *arg)
++{
++ int result = PAM_SUCCESS;
++ int i;
++ *resp = (struct pam_response *) calloc(num, sizeof(struct pam_response));
++ for(i=0;i<num;i++)
++ {
++ //printf("MSG: %d %s\n",msg[i]->msg_style,msg[i]->msg);
++ switch(msg[i]->msg_style){
++ case PAM_PROMPT_ECHO_ON:
++ resp[i]->resp=strdup(user_pass[0]?user_pass[0]:"");
++ break;
++ case PAM_PROMPT_ECHO_OFF:
++ //resp[i]->resp=strdup(user_pass[1]?user_pass[1]:"");
++ resp[i]->resp=user_pass[1]?strdup(user_pass[1]):NULL;
++ break;
++ case PAM_ERROR_MSG:
++ case PAM_TEXT_INFO:
++ //printf("PAM: %s\n",msg[i]->msg);
++ break;
++ default:
++ break;
++ }
++ }
++ return result;
++}
++
++static struct pam_conv conv={.conv=do_conv,.appdata_ptr=user_pass};
++
++int lxdm_auth_init(LXDM_AUTH *a)
++{
++ memset(a,0,sizeof(*a));
++ return 0;
++}
++
++int lxdm_auth_cleanup(LXDM_AUTH *a)
++{
++ passwd_clean(&a->pw);
++ return 0;
++}
++
++int lxdm_auth_user_authenticate(LXDM_AUTH *a,const char *user,const char *pass,int type)
++{
++ struct passwd *pw;
++ if(!user || !user[0])
++ {
++ g_debug("user==NULL\n");
++ return AUTH_ERROR;
++ }
++ pw = getpwnam(user);
++ endpwent();
++ if(!pw)
++ {
++ g_debug("user %s not found\n",user);
++ return AUTH_BAD_USER;
++ }
++ if(strstr(pw->pw_shell, "nologin"))
++ {
++ g_debug("user %s have nologin shell\n",user);
++ return AUTH_PRIV;
++ }
++ if(a->handle) pam_end(a->handle,0);
++ if(PAM_SUCCESS != pam_start("lxdm", pw->pw_name, &conv, (pam_handle_t**)&a->handle))
++ {
++ a->handle=NULL;
++ g_debug("user %s start pam fail\n",user);
++ return AUTH_FAIL;
++ }
++ else
++ {
++ int ret;
++ if(type==AUTH_TYPE_AUTO_LOGIN && !pass)
++ goto out;
++ user_pass[0]=(char*)user;user_pass[1]=(char*)pass;
++ ret=pam_authenticate(a->handle,PAM_SILENT);
++ user_pass[0]=0;user_pass[1]=0;
++ if(ret!=PAM_SUCCESS)
++ {
++ g_debug("user %s auth fail with %d\n",user,ret);
++ return AUTH_FAIL;
++ }
++ ret=pam_acct_mgmt(a->handle,PAM_SILENT);
++ if(ret!=PAM_SUCCESS)
++ {
++ g_debug("user %s acct mgmt fail with %d\n",user,ret);
++ return AUTH_FAIL;
++ }
++ }
++out:
++ passwd_copy(&a->pw,pw);
++ return AUTH_SUCCESS;
++}
++
++int lxdm_auth_session_begin(LXDM_AUTH *a,const char *name,int tty,int display,char mcookie[16])
++{
++ int err;
++ char x[256];
++
++ if(!a->handle)
++ {
++ return -1;
++ }
++ sprintf(x, "tty%d", tty);
++ pam_set_item(a->handle, PAM_TTY, x);
++#ifdef PAM_XDISPLAY
++ sprintf(x,":%d",display);
++ pam_set_item(a->handle, PAM_XDISPLAY, x);
++#endif
++#if !defined(DISABLE_XAUTH) && defined(PAM_XAUTHDATA)
++ struct pam_xauth_data value;
++ value.name="MIT-MAGIC-COOKIE-1";
++ value.namelen=18;
++ value.data=mcookie;
++ value.datalen=16;
++ pam_set_item (a->handle, PAM_XAUTHDATA, &value);
++#endif
++ if(name && name[0])
++ {
++ char *env;
++ env = g_strdup_printf ("DESKTOP_SESSION=%s", name);
++ pam_putenv (a->handle, env);
++ g_free (env);
++ }
++ err = pam_open_session(a->handle, 0); /* FIXME pam session failed */
++ if( err != PAM_SUCCESS )
++ g_warning( "pam open session error \"%s\"\n", pam_strerror(a->handle, err));
++ return 0;
++}
++
++int lxdm_auth_session_end(LXDM_AUTH *a)
++{
++ int err;
++ if(!a->handle)
++ return 0;
++ err = pam_close_session(a->handle, 0);
++ pam_end(a->handle, err);
++ a->handle = NULL;
++ passwd_clean(&a->pw);
++ return 0;
++}
++
++int lxdm_auth_clean_for_child(LXDM_AUTH *a)
++{
++ pam_end(a->handle,0);
++ return 0;
++}
++
++void lxdm_auth_print_env(LXDM_AUTH *a)
++{
++ int i;
++ char **penv;
++ if(!a->handle) return;
++ penv=pam_getenvlist(a->handle);
++ if(!penv) return;
++ for(i=0;penv[i]!=NULL;i++)
++ {
++ if(i!=0) printf(" ");
++ printf("%s",penv[i]);
++ }
++ free(penv);
++}
++
++void lxdm_auth_put_env(LXDM_AUTH *a)
++{
++ int i;
++ char **penv;
++
++ if(!a->handle) return;
++ penv=pam_getenvlist(a->handle);
++ if(!penv) return;
++ for(i=0;penv[i]!=NULL;i++)
++ {
++ if(i!=0) printf(" ");
++ if(0!=putenv(penv[i]))
++ perror("putenv");
++ }
++ free(penv);
++}
++
++#endif
++
++static void close_left_fds(void)
++{
++ struct dirent **list;
++ char path[256];
++ int n;
++
++ snprintf(path,sizeof(path),"/proc/%d/fd",getpid());
++ n=scandir(path,&list,0,0);
++ if(n<0) return;
++ while(n--)
++ {
++ int fd=atoi(list[n]->d_name);
++ free(list[n]);
++ if(fd<=STDERR_FILENO)
++ continue;
++ close(fd);
++ }
++ free(list);
++
++ int fd = open("/dev/null", O_WRONLY);
++ if(fd == -1) return;
++ dup2(fd, 1);
++ dup2(fd, 2);
++ close(fd);
++}
++
++void switch_user(struct passwd *pw, const char *run, char **env)
++{
++ int fd;
++
++ setenv("USER",pw->pw_name,1);
++ setenv("LOGNAME",pw->pw_name,1);
++ setenv("SHELL",pw->pw_shell,1);
++ setenv("HOME",pw->pw_dir,1);
++
++ g_spawn_command_line_sync ("/etc/lxdm/PreLogin",NULL,NULL,NULL,NULL);
++
++ if( !pw || initgroups(pw->pw_name, pw->pw_gid) ||
++ setgid(pw->pw_gid) || setuid(pw->pw_uid)/* || setsid() == -1 */)
++ exit(EXIT_FAILURE);
++ chdir(pw->pw_dir);
++ fd=open(".xsession-errors",O_WRONLY|O_CREAT|O_TRUNC,S_IRUSR|S_IWUSR);
++ if(fd!=-1)
++ {
++ dup2(fd,STDERR_FILENO);
++ close(fd);
++ }
++
++ /* reset signal */
++ signal(SIGCHLD, SIG_DFL);
++ signal(SIGTERM, SIG_DFL);
++ signal(SIGPIPE, SIG_DFL);
++ signal(SIGALRM, SIG_DFL);
++ signal(SIGHUP, SIG_DFL);
++ close_left_fds();
++
++ g_spawn_command_line_async ("/etc/lxdm/PostLogin",NULL);
++ execle("/etc/lxdm/Xsession", "/etc/lxdm/Xsession", run, NULL, environ);
++ perror("execle");
++ exit(EXIT_FAILURE);
++}
++
++void run_session(LXDM_AUTH *a,const char *run)
++{
++ setsid();
++ a->child=fork();
++ if(a->child==0)
++ {
++ lxdm_auth_put_env(a);
++ lxdm_auth_clean_for_child(a);
++ switch_user(&a->pw,run,NULL);
++ _exit(EXIT_FAILURE);
++ }
++}
++
++LXDM_AUTH a;
++static int session_exit=0;
++
++static int xreadline(int fd,char *buf,size_t size)
++{
++ int i;
++ for(i=0;i<size-1;i++)
++ {
++ int ret;
++ do{
++ ret=read(fd,buf+i,1);
++ }while(ret==-1 && errno==EINTR);
++ if(buf[i]==-1 || buf[i]=='\n')
++ break;
++ }
++ buf[i]=0;
++ return i;
++}
++
++int file_get_line(char *line, size_t n, FILE *fp)
++{
++ int len;
++
++ if(session_exit)
++ return -1;
++/*
++ if(!fgets(line,n,fp))
++ return -1;
++ len=strcspn(line,"\r\n");
++ line[len]=0;
++*/
++
++ struct pollfd fds;
++ fds.fd=fileno(fp);
++ fds.events=POLLIN;
++ poll(&fds,1,-1);
++ if(session_exit)
++ return -1;
++
++ len=xreadline(fileno(fp),line,n);
++ return len;
++}
++
++void sig_handler(int sig)
++{
++ if(sig==SIGCHLD)
++ {
++ int wpid, status;
++ while(1)
++ {
++ wpid = waitpid(-1,&status,0);
++ if(wpid==a.child)
++ {
++ session_exit=1;
++ }
++ if(wpid<0) break;
++ }
++ }
++}
++
++int main(int arc,char *arg[])
++{
++ char cmd[128];
++ int ret;
++
++ setvbuf(stdout, NULL, _IOLBF, 0 );
++ signal(SIGCHLD,sig_handler);
++
++ lxdm_auth_init(&a);
++ while(file_get_line(cmd,sizeof(cmd),stdin)>=0)
++ {
++ //fprintf(stderr,"begin %s\n",cmd);
++ if(!strcmp(cmd,"auth"))
++ {
++ char temp[8],user[64],pass[64];
++ int type;
++ ret=file_get_line(temp,sizeof(temp),stdin);
++ if(ret<0) break;
++ type=atoi(temp);
++ ret=file_get_line(user,sizeof(user),stdin);
++ if(ret<0) break;
++ if(type==AUTH_TYPE_NORMAL)
++ {
++ ret=file_get_line(pass,sizeof(pass),stdin);
++ if(ret<0) break;
++ ret=lxdm_auth_user_authenticate(&a,user,pass,type);
++ }
++ else
++ {
++ ret=lxdm_auth_user_authenticate(&a,user,NULL,type);
++ }
++ printf("%d\n",ret);
++ if(ret==AUTH_SUCCESS)
++ {
++ printf("%d\n",a.pw.pw_uid);
++ printf("%d\n",a.pw.pw_gid);
++ printf("%s\n",a.pw.pw_gecos?:"");
++ printf("%s\n",a.pw.pw_dir);
++ printf("%s\n",a.pw.pw_shell);
++ }
++ }
++ else if(!strcmp(cmd,"begin"))
++ {
++ char name[128],tty[8],display[8],mcookie[32];
++ gsize out_len;
++ ret=file_get_line(name,sizeof(name),stdin);
++ if(ret<0) break;
++ ret=file_get_line(tty,sizeof(tty),stdin);
++ if(ret<0) break;
++ ret=file_get_line(display,sizeof(display),stdin);
++ if(ret<0) break;
++ ret=file_get_line(mcookie,sizeof(mcookie),stdin);
++ if(ret<0) break;
++ g_base64_decode_inplace(mcookie,&out_len);
++ ret=lxdm_auth_session_begin(&a,name,atoi(tty),atoi(display),mcookie);
++ printf("%d\n",ret);
++ }
++ else if(!strcmp(cmd,"end"))
++ {
++ ret=lxdm_auth_session_end(&a);
++ printf("%d\n",ret);
++ }
++ else if(!strcmp(cmd,"env"))
++ {
++ lxdm_auth_print_env(&a);
++ printf("\n");
++ }
++ else if(!strcmp(cmd,"putenv"))
++ {
++ char env[1024];
++ while(file_get_line(env,sizeof(env),stdin)>0)
++ {
++ putenv(env);
++ }
++ }
++ else if(!strcmp(cmd,"exec"))
++ {
++ char run[256];
++ if(file_get_line(run,sizeof(run),stdin)>0)
++ run_session(&a,run);
++ }
++ else if(!strcmp(cmd,"exit"))
++ {
++ break;
++ }
++ //fprintf(stderr,"end\n");
++ }
++ lxdm_auth_cleanup(&a);
++ return 0;
++}
++
diff --git a/src/ui.c b/src/ui.c
-index 2691a03..cd6d7de 100644
+index 2691a03..f233589 100644
--- a/src/ui.c
+++ b/src/ui.c
@@ -20,8 +20,6 @@
@@ -1979,7 +3533,15 @@ index 2691a03..cd6d7de 100644
#include <string.h>
#include <poll.h>
#include <grp.h>
-@@ -153,7 +151,7 @@ static gboolean on_greeter_input(GIOChannel *source, GIOCondition condition, gpo
+@@ -34,6 +32,7 @@
+
+ #include "lxdm.h"
+ #include "lxcom.h"
++#include "auth.h"
+
+ static pid_t greeter = -1;
+ static int greeter_pipe[2];
+@@ -153,17 +152,22 @@ static gboolean on_greeter_input(GIOChannel *source, GIOCondition condition, gpo
char *pass = greeter_param(str, "pass");
char *session = greeter_param(str, "session");
char *lang = greeter_param(str, "lang");
@@ -1987,8 +3549,11 @@ index 2691a03..cd6d7de 100644
+ if( user/* && pass */)
{
struct passwd *pw;
- int ret = lxdm_auth_user(user, pass, &pw);
-@@ -163,7 +161,12 @@ static gboolean on_greeter_input(GIOChannel *source, GIOCondition condition, gpo
+- int ret = lxdm_auth_user(user, pass, &pw);
++ int ret = lxdm_auth_user(AUTH_TYPE_NORMAL, user, pass, &pw);
+ if( AUTH_SUCCESS == ret && pw != NULL )
+ {
+ ui_drop();
lxdm_do_login(pw, session, lang,NULL);
}
else
@@ -2002,6 +3567,15 @@ index 2691a03..cd6d7de 100644
}
g_free(user);
g_free(pass);
+@@ -180,7 +184,7 @@ static gboolean on_greeter_input(GIOChannel *source, GIOCondition condition, gpo
+ if(user)
+ {
+ struct passwd *pw;
+- int ret = lxdm_auth_user(user, pass, &pw);
++ int ret = lxdm_auth_user(AUTH_TYPE_AUTO_LOGIN, user, pass, &pw);
+ if( AUTH_SUCCESS == ret && pw != NULL )
+ {
+ ui_drop();
diff --git a/systemd/Makefile.am b/systemd/Makefile.am
new file mode 100644
index 0000000..b568c5a
diff --git a/community/sigil/PKGBUILD b/community/sigil/PKGBUILD
index dfc11299f..b94613e44 100644
--- a/community/sigil/PKGBUILD
+++ b/community/sigil/PKGBUILD
@@ -1,10 +1,10 @@
-# $Id: PKGBUILD 94050 2013-07-13 12:37:15Z svenstaro $
+# $Id: PKGBUILD 97088 2013-09-12 10:47:29Z giovanni $
# Maintainer: Giovanni Scafora <giovanni@archlinux.org>
# Contributor: Larry Hajali <larryhaja [at] gmail [dot] com>
pkgname=sigil
-pkgver=0.7.2
-pkgrel=2
+pkgver=0.7.3
+pkgrel=1
pkgdesc="WYSIWYG ebook editor"
arch=('i686' 'x86_64')
url="http://code.google.com/p/sigil/"
@@ -13,7 +13,7 @@ depends=('qt5-webkit' 'boost-libs')
makedepends=('qt5-tools' 'qt5-svg' 'cmake' 'gendesk' 'boost')
install=sigil.install
source=("http://sigil.googlecode.com/files/Sigil-${pkgver}-Code.zip")
-md5sums=('540745983db57a2150cc2f4057455b19')
+md5sums=('13630c59bd85e91b96e312b4d39e5087')
build() {
cd "${srcdir}"
diff --git a/community/tea/PKGBUILD b/community/tea/PKGBUILD
index 0c234c9f6..72eb0b320 100644
--- a/community/tea/PKGBUILD
+++ b/community/tea/PKGBUILD
@@ -1,4 +1,4 @@
-# $Id: PKGBUILD 93973 2013-07-12 10:33:33Z spupykin $
+# $Id: PKGBUILD 97073 2013-09-12 10:15:01Z spupykin $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Maintainer: Andrea Scarpino <andrea@archlinux.org>
# Contributor: Roman Kyrylych <roman@archlinux.org>
@@ -6,9 +6,9 @@
# Contributor: Zsolt Varadi <sysop_xxl@fibermail.hu>
pkgname=tea
-pkgver=36.0.2
+pkgver=36.0.3
pkgrel=1
-pkgdesc="A QT-based text editor for Linux and *BSD. With an ultimate small size TEA provides you hundreds of functions."
+pkgdesc="A Qt-based text editor for Linux and *BSD. With an ultimate small size TEA provides you hundreds of functions."
arch=('i686' 'x86_64')
url="http://semiletov.org/tea/"
license=('GPL')
@@ -16,7 +16,7 @@ depends=('qt4' 'aspell' 'hunspell')
install=tea.install
source=(http://semiletov.org/tea/dloads/tea-$pkgver.tar.bz2
tea.desktop)
-md5sums=('c8657c664af35d2032a78c645cb38d16'
+md5sums=('2e33f9a150f17eea62d9a805033fe16b'
'377ace3363124f4c086de0babb820761')
build() {
diff --git a/community/tix/PKGBUILD b/community/tix/PKGBUILD
index fd24d859b..a81b64c5c 100644
--- a/community/tix/PKGBUILD
+++ b/community/tix/PKGBUILD
@@ -1,28 +1,41 @@
-# $Id: PKGBUILD 78264 2012-10-17 10:27:42Z allan $
+# $Id: PKGBUILD 97075 2013-09-12 10:15:40Z spupykin $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Brice Méalier <mealier_brice@yahoo.fr>
pkgname=tix
pkgver=8.4.3
-pkgrel=4
+pkgrel=5
pkgdesc="Tk Interface eXtension, a powerful set of user interface components"
arch=(i686 'x86_64')
url="http://tix.sourceforge.net/"
license=("BSD")
depends=('tk' 'libx11')
-source=(http://downloads.sourceforge.net/tix/Tix$pkgver-src.tar.gz
- tcl-tk-path.patch)
+source=("http://downloads.sourceforge.net/tix/Tix$pkgver-src.tar.gz"
+ "tix-8.4.3-tcl8.6.patch::https://bugs.archlinux.org/task/36882?getfile=10973"
+ "tcl-tk-path.patch")
md5sums=('2b8bf4b10a852264678182652f477e59'
+ 'c26297f9e1744dc38308a062ef00549e'
'd4df48da39dd51872d58706a51bab505')
-build() {
+prepare() {
cd $srcdir/Tix$pkgver
+ sed -i -e 's:-Os::g' -i configure tclconfig/tcl.m4
+ patch -Np1 -i "${srcdir}/tix-8.4.3-tcl8.6.patch"
+ sed -i -e 's:generic/tclInt.h:tclInt.h:g' configure
+ sed -i -e 's:generic/tkInt.h:tkInt.h:g' configure
+}
- patch -p1 <$srcdir/tcl-tk-path.patch
+build() {
+ cd $srcdir/Tix$pkgver
export CFLAGS="$CFLAGS -DERR_IN_PROGRESS=2"
+ [[ $CARCH == "x86_64" ]] && BIT="--enable-64bit"
+
+ ./configure --prefix=/usr \
+ --with-tcl=/usr/lib \
+ --with-tk=/usr/lib \
+ $BIT \
- ./configure --prefix=/usr
make
make DESTDIR=$pkgdir install
# move things around
@@ -37,10 +50,9 @@ build() {
cp -p man/tixwish.1 $pkgdir/usr/share/man/man1
cd $srcdir/Tix$pkgver/man
for i in *.n; do
- cp -p $i $pkgdir/usr/share/man/man3/${i%n}3
+ cp -p $i $pkgdir/usr/share/man/man3/${i%n}3
done
mkdir -p $pkgdir/usr/share/licenses/tix
cp $srcdir/Tix$pkgver/license.terms $pkgdir/usr/share/licenses/tix/
}
-
diff --git a/community/torcs/PKGBUILD b/community/torcs/PKGBUILD
index 02189a556..aa4002407 100644
--- a/community/torcs/PKGBUILD
+++ b/community/torcs/PKGBUILD
@@ -1,10 +1,10 @@
-# $Id: PKGBUILD 90096 2013-05-06 19:39:45Z foutrelis $
+# $Id: PKGBUILD 97077 2013-09-12 10:16:00Z spupykin $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Shahar Weiss <sweiss4@gmx.net>
pkgname=torcs
pkgver=1.3.4
-pkgrel=2
+pkgrel=4
pkgdesc="A 3D racing cars simulator using OpenGL"
url="http://torcs.sourceforge.net"
license=("GPL")
@@ -12,10 +12,8 @@ arch=('i686' 'x86_64')
depends=('freeglut' 'libpng' 'freealut' 'libxi' 'libxmu' 'libxrandr' 'libvorbis' 'glu')
makedepends=('plib' 'mesa')
options=('!makeflags')
-source=(http://downloads.sourceforge.net/sourceforge/$pkgname/$pkgname-${pkgver/_/-}.tar.bz2
- torcs.desktop)
-md5sums=('07dbc9c53e2b177be1f53fe97d53d039'
- '328e419e9f985c3e7b69924fe299330d')
+source=(http://downloads.sourceforge.net/sourceforge/$pkgname/$pkgname-${pkgver/_/-}.tar.bz2)
+md5sums=('07dbc9c53e2b177be1f53fe97d53d039')
build() {
cd $srcdir/$pkgname-${pkgver/_/-}
@@ -29,6 +27,6 @@ package() {
cd $srcdir/$pkgname-${pkgver/_/-}
make DESTDIR=${pkgdir} install
install -D -m644 Ticon.png ${pkgdir}/usr/share/pixmaps/torcs.png
- install -D -m644 ../torcs.desktop ${pkgdir}/usr/share/applications/torcs.desktop
+ install -D -m644 torcs.desktop ${pkgdir}/usr/share/applications/torcs.desktop
find ${pkgdir} -type d -exec chmod 755 {} \;
}
diff --git a/community/torcs/torcs.desktop b/community/torcs/torcs.desktop
deleted file mode 100644
index 03d1ba010..000000000
--- a/community/torcs/torcs.desktop
+++ /dev/null
@@ -1,9 +0,0 @@
-[Desktop Entry]
-Name=TORCS
-Comment=The Open Racing Car Simulator
-Exec=torcs
-Icon=torcs.png
-Terminal=false
-Type=Application
-Encoding=UTF-8
-Categories=Application;Game;
diff --git a/community/xboard/PKGBUILD b/community/xboard/PKGBUILD
index b2ca19414..33f49f31a 100644
--- a/community/xboard/PKGBUILD
+++ b/community/xboard/PKGBUILD
@@ -1,11 +1,11 @@
-# $Id: PKGBUILD 90592 2013-05-13 10:00:14Z spupykin $
+# $Id: PKGBUILD 97081 2013-09-12 10:17:03Z spupykin $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Jason Chu <jason@archlinux.org>
# Contributor: Tom Newsom <Jeepster@gmx.co.uk>
pkgname=xboard
pkgver=4.7.1
-pkgrel=1
+pkgrel=3
pkgdesc="Graphical user interfaces for chess"
arch=('i686' 'x86_64')
url="http://www.gnu.org/software/xboard/"
@@ -21,7 +21,7 @@ md5sums=('e42383c4594c24ebf2f9fdc5dc89e255')
build() {
cd "${srcdir}"
- gendesk
+ gendesk $startdir/PKGBUILD
cd "${pkgname}-${pkgver}"
sed -i 's/fairymax/gnuchess/g' {xaw,gtk}/xboard.h xboard.conf.in
@@ -37,8 +37,7 @@ package() {
cd "${srcdir}/${pkgname}-${pkgver}"
make DESTDIR="${pkgdir}" install
- install -Dm644 ${srcdir}/${pkgname}.desktop \
- ${pkgdir}/usr/share/applications/${pkgname}.desktop
+
install -Dm644 ${srcdir}/${pkgname}.png \
${pkgdir}/usr/share/pixmaps/${pkgname}.png
install -Dm755 ${srcdir}/${pkgname}-${pkgver}/cmail \
diff --git a/community/xboard/xboard.desktop b/community/xboard/xboard.desktop
deleted file mode 100644
index 4bdfdbe15..000000000
--- a/community/xboard/xboard.desktop
+++ /dev/null
@@ -1,10 +0,0 @@
-[Desktop Entry]
-Encoding=UTF-8
-Type=Application
-Name=Xboard
-Comment=A graphical user interfaces for chess
-Exec=xboard
-Icon=xboard.png
-Terminal=false
-StartupNotify=false
-Categories=Application;
diff --git a/extra/ibus/PKGBUILD b/extra/ibus/PKGBUILD
index e19629798..016d40dbe 100644
--- a/extra/ibus/PKGBUILD
+++ b/extra/ibus/PKGBUILD
@@ -1,4 +1,4 @@
-# $Id: PKGBUILD 191614 2013-07-27 18:39:53Z eric $
+# $Id: PKGBUILD 194263 2013-09-11 22:22:58Z eric $
# Contributor: Rainy <rainylau(at)gmail(dot)com>
# Contributor: Lee.MaRS <leemars at gmail dot com>
# Contributor: Daniel J Griffiths <ghost1227@archlinux.us>
@@ -6,7 +6,7 @@
pkgname=ibus
pkgver=1.5.3
-pkgrel=1
+pkgrel=2
pkgdesc="Next Generation Input Bus for Linux"
arch=('i686' 'x86_64')
url="http://ibus.googlecode.com"
diff --git a/extra/ibus/ibus.install b/extra/ibus/ibus.install
index 0b5ce0196..4bc5288cf 100644
--- a/extra/ibus/ibus.install
+++ b/extra/ibus/ibus.install
@@ -1,17 +1,16 @@
post_install() {
- gtk-query-immodules-2.0 --update-cache
- gtk-query-immodules-3.0 --update-cache
+ gtk-query-immodules-2.0 --update-cache
+ gtk-query-immodules-3.0 --update-cache
- gtk-update-icon-cache -fq -t usr/share/icons/hicolor
+ gtk-update-icon-cache -fq -t /usr/share/icons/hicolor
- glib-compile-schemas /usr/share/glib-2.0/schemas
+ glib-compile-schemas /usr/share/glib-2.0/schemas
}
-post_remove() {
- gtk-query-immodules-2.0 --update-cache
- gtk-query-immodules-3.0 --update-cache
-
- gtk-update-icon-cache -fq -t usr/share/icons/hicolor
+post_upgrade() {
+ post_install
+}
- glib-compile-schemas /usr/share/glib-2.0/schemas
+post_remove() {
+ post_install
}
diff --git a/extra/mesa/PKGBUILD b/extra/mesa/PKGBUILD
index b64894f08..1507ce9c4 100644
--- a/extra/mesa/PKGBUILD
+++ b/extra/mesa/PKGBUILD
@@ -1,11 +1,11 @@
-# $Id: PKGBUILD 193703 2013-08-28 15:19:08Z andyrtr $
+# $Id: PKGBUILD 194265 2013-09-12 09:44:15Z lcarlier $
# Maintainer: Jan de Groot <jgc@archlinux.org>
# Maintainer: Andreas Radke <andyrtr@archlinux.org>
pkgbase=mesa
pkgname=('ati-dri' 'intel-dri' 'nouveau-dri' 'svga-dri' 'mesa' 'mesa-libgl')
pkgver=9.2.0
-pkgrel=1
+pkgrel=2
arch=('i686' 'x86_64')
makedepends=('python2' 'libxml2' 'libx11' 'glproto' 'libdrm' 'dri2proto' 'libxxf86vm' 'libxdamage'
'libvdpau' 'wayland' 'elfutils' 'llvm' 'systemd')
@@ -18,11 +18,11 @@ md5sums=('4185b6aae890bc62a964f4b24cc1aca8'
'5c65a0fe315dd347e09b1f2826a1df5a')
build() {
- cd ${srcdir}/?esa-*
+ cd ${srcdir}/?esa-*
- autoreconf -vfi # our automake is far too new for their build system :)
+ autoreconf -vfi # our automake is far too new for their build system :)
- ./configure --prefix=/usr \
+ ./configure --prefix=/usr \
--sysconfdir=/etc \
--with-dri-driverdir=/usr/lib/xorg/modules/dri \
--with-gallium-drivers=r300,r600,radeonsi,nouveau,svga,swrast \
@@ -45,11 +45,11 @@ build() {
--enable-vdpau \
# --help
- make
+ make
- # fake installation
- mkdir $srcdir/fakeinstall
- make DESTDIR=${srcdir}/fakeinstall install
+ # fake installation
+ mkdir $srcdir/fakeinstall
+ make DESTDIR=${srcdir}/fakeinstall install
}
package_ati-dri() {
@@ -97,6 +97,9 @@ package_nouveau-dri() {
install -m755 -d ${pkgdir}/usr/lib/gallium-pipe
mv -v ${srcdir}/fakeinstall/usr/lib/gallium-pipe/pipe_nouveau* ${pkgdir}/usr/lib/gallium-pipe/
+ # vdpau drivers are still buggy with nouveau, so remove them (FS#36754)
+ rm -rf ${pkgdir}/usr/lib/vdpau/
+
install -m755 -d "${pkgdir}/usr/share/licenses/nouveau-dri"
install -m644 "${srcdir}/LICENSE" "${pkgdir}/usr/share/licenses/nouveau-dri/"
}
diff --git a/extra/refind-efi/PKGBUILD b/extra/refind-efi/PKGBUILD
index 1b919070b..aef4fa34c 100644
--- a/extra/refind-efi/PKGBUILD
+++ b/extra/refind-efi/PKGBUILD
@@ -1,23 +1,24 @@
-# $Id: PKGBUILD 193534 2013-08-22 15:56:50Z tpowa $
+# $Id: PKGBUILD 194269 2013-09-12 15:17:40Z tpowa $
# Maintainer: Tobias Powalowski <tpowa@archlinux.org>
-# Contributor: Keshav Padram <(the.ridikulus.rat) (aatt) (gemmaeiil) (ddoott) (ccoomm)>
+# Contributor: Keshav Padram Amburay <(the.ridikulus.rat) (aatt) (gemmaeiil) (ddoott) (ccoomm)>
#######
_TIANOCORE_SVN_URL="https://svn.code.sf.net/p/edk2/code/branches/UDK2010.SR1"
# BaseTools MdePkg MdeModulePkg IntelFrameworkPkg IntelFrameworkModulePkg
_TIANO_DIR_="tianocore-udk-svn"
+_TIANO_SVN_REV_="14641"
#######
#######
_TIANOCORE_PKG="Mde"
_TIANOCORE_TARGET="RELEASE"
_UDK_TARGET="${_TIANOCORE_PKG}Pkg/${_TIANOCORE_PKG}Pkg.dsc"
-_COMPILER="GCC46"
+_COMPILER="GCC47"
#######
pkgname="refind-efi"
-pkgver="0.7.3"
-pkgrel="2"
+pkgver="0.7.4"
+pkgrel="1"
pkgdesc="Rod Smith's fork of rEFIt UEFI Boot Manager - built with Tianocore UDK libs"
url="http://www.rodsbooks.com/refind/index.html"
arch=('x86_64' 'i686')
@@ -36,10 +37,10 @@ source=("http://downloads.sourceforge.net/refind/refind-src-${pkgver}.zip"
'refind_linux.conf')
for _DIR_ in BaseTools MdePkg MdeModulePkg IntelFrameworkPkg IntelFrameworkModulePkg ; do
- source+=("${_TIANO_DIR_}/${_DIR_}::svn+${_TIANOCORE_SVN_URL}/${_DIR_}")
+ source+=("${_TIANO_DIR_}_${_DIR_}::svn+${_TIANOCORE_SVN_URL}/${_DIR_}#revision=${_TIANO_SVN_REV_}")
done
-sha1sums=('5e4b15202efc658e58e68e64af8a1b2c84aab175'
+sha1sums=('410d2694c5005a5312d48414df8acf8291da42a9'
'3d53eb615c3363d45feb95b9bfbf1d5491bf1c24'
'SKIP'
'SKIP'
@@ -70,7 +71,7 @@ _prepare_tianocore_sources() {
mkdir -p "${_UDK_DIR}/"
for _DIR_ in BaseTools MdePkg MdeModulePkg IntelFrameworkPkg IntelFrameworkModulePkg ; do
- mv "${srcdir}/${_DIR_}" "${_UDK_DIR}/${_DIR_}"
+ mv "${srcdir}/${_TIANO_DIR_}_${_DIR_}" "${_UDK_DIR}/${_DIR_}"
done
cd "${_UDK_DIR}/"
@@ -98,6 +99,10 @@ _prepare_tianocore_sources() {
sed 's|DEFINE GCC_ALL_CC_FLAGS = -g |DEFINE GCC_ALL_CC_FLAGS = -Os -mabi=ms |g' -i "${EDK_TOOLS_PATH}/Conf/tools_def.template" || true
sed 's|DEFINE GCC44_ALL_CC_FLAGS = -g |DEFINE GCC44_ALL_CC_FLAGS = -Os -mabi=ms |g' -i "${EDK_TOOLS_PATH}/Conf/tools_def.template" || true
+ msg "Fix GenFw: ERROR 3000: Invalid, refind_x64.dll bad symbol definition"
+ ## http://www.mail-archive.com/edk2-devel@lists.sourceforge.net/msg03625.html
+ sed -e 's|_OBJCOPY_FLAGS =|_OBJCOPY_FLAGS = -R .eh_frame|g' -i "${EDK_TOOLS_PATH}/Conf/tools_def.template" || true
+
msg "Fix UDK Target Platform"
sed "s|ACTIVE_PLATFORM = Nt32Pkg/Nt32Pkg.dsc|ACTIVE_PLATFORM = ${_UDK_TARGET}|g" -i "${EDK_TOOLS_PATH}/Conf/target.template" || true
sed "s|TARGET = DEBUG|TARGET = ${_TIANOCORE_TARGET}|g" -i "${EDK_TOOLS_PATH}/Conf/target.template" || true
@@ -120,6 +125,11 @@ _prepare_refind_sources() {
sed "s|EDK2BASE = /usr/local/UDK2010/MyWorkSpace|EDK2BASE = ${_UDK_DIR}|g" -i "${srcdir}/refind-${pkgver}/filesystems/Make.tiano" || true
sed "s|EDK2BASE = /usr/local/UDK2010/MyWorkSpace|EDK2BASE = ${_UDK_DIR}|g" -i "${srcdir}/refind-${pkgver}/gptsync/Make.tiano" || true
+ msg "Fix GenFw: ERROR 3000: Invalid, refind_x64.dll bad symbol definition"
+ sed -e 's|--strip-unneeded|--strip-unneeded -R .eh_frame|g' -i "${srcdir}/refind-${pkgver}/refind/Make.tiano" || true
+ sed -e 's|--strip-unneeded|--strip-unneeded -R .eh_frame|g' -i "${srcdir}/refind-${pkgver}/filesystems/Make.tiano"
+ sed -e 's|--strip-unneeded|--strip-unneeded -R .eh_frame|g' -i "${srcdir}/refind-${pkgver}/gptsync/Make.tiano" || true
+
}
prepare() {
@@ -242,10 +252,3 @@ package() {
sed 's|^ThisScript=.*|ThisScript="/usr/bin/refind-install"|g' -i "${pkgdir}/usr/bin/refind-install"
}
-sha1sums=('baac40c10b26b337c85248aa8e2b61ab4f06f73d'
- '3d53eb615c3363d45feb95b9bfbf1d5491bf1c24'
- 'SKIP'
- 'SKIP'
- 'SKIP'
- 'SKIP'
- 'SKIP')
diff --git a/extra/tcl/PKGBUILD b/extra/tcl/PKGBUILD
index 999f1f695..fdde612e2 100644
--- a/extra/tcl/PKGBUILD
+++ b/extra/tcl/PKGBUILD
@@ -1,9 +1,9 @@
-# $Id: PKGBUILD 192225 2013-08-08 07:36:39Z eric $
+# $Id: PKGBUILD 194261 2013-09-11 22:07:57Z eric $
# Maintainer: Eric Bélanger <eric@archlinux.org>
pkgname=tcl
pkgver=8.6.0
-pkgrel=5
+pkgrel=6
pkgdesc="The Tcl scripting language"
arch=('i686' 'x86_64')
url="http://tcl.sourceforge.net/"
@@ -41,5 +41,18 @@ package() {
install -Dm644 ../license.terms "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
# remove buildroot traces
- sed -i "s#${srcdir}#/usr/src#" "${pkgdir}"/usr/lib/{tcl,tdbc1.0.0/tdbc,itcl4.0.0/itcl}Config.sh
+ sed -e "s#${srcdir}/tcl${pkgver}/unix#/usr/lib#" \
+ -e "s#${srcdir}/tcl${pkgver}#/usr/include#" \
+ -i "${pkgdir}/usr/lib/tclConfig.sh"
+
+ sed -e "s#${srcdir}/tcl${pkgver}/unix/pkgs/tdbc1.0.0#/usr/lib/tdbc1.0.0#" \
+ -e "s#${srcdir}/tcl${pkgver}/pkgs/tdbc1.0.0/generic#/usr/include#" \
+ -e "s#${srcdir}/tcl${pkgver}/pkgs/tdbc1.0.0/library#/usr/lib/tcl${pkgver%.*}#" \
+ -e "s#${srcdir}/tcl${pkgver}/pkgs/tdbc1.0.0#/usr/include#" \
+ -i "${pkgdir}/usr/lib/tdbc1.0.0/tdbcConfig.sh"
+
+ sed -e "s#${srcdir}/tcl${pkgver}/unix/pkgs/itcl4.0.0#/usr/lib/itcl4.0.0#" \
+ -e "s#${srcdir}/tcl${pkgver}/pkgs/itcl4.0.0/generic#/usr/include#" \
+ -e "s#${srcdir}/tcl${pkgver}/pkgs/itcl4.0.0#/usr/include#" \
+ -i "${pkgdir}/usr/lib/itcl4.0.0/itclConfig.sh"
}
diff --git a/extra/transcode/04_ffmpeg_options.patch b/extra/transcode/04_ffmpeg_options.patch
deleted file mode 100644
index d0429b1d9..000000000
--- a/extra/transcode/04_ffmpeg_options.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-Description: Remove "-vpre medium" from ffmpeg's command-line arguments list.
-Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=681436
-From: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=681436#25
----
- export/ffmpeg_cfg.c | 3 +--
- 1 file changed, 1 insertion(+), 2 deletions(-)
-
---- transcode.orig/export/ffmpeg_cfg.c
-+++ transcode/export/ffmpeg_cfg.c
-@@ -126,7 +126,7 @@ int lavc_param_gmc = 0;
- //int lavc_param_atag = 0;
- //int lavc_param_abitrate = 224;
-
--char *lavc_param_video_preset = "medium";
-+char *lavc_param_video_preset = NULL;
- char *lavc_param_ffmpeg_datadir = "/usr/share/ffmpeg";
-
- TCConfigEntry lavcopts_conf[]={
-@@ -237,7 +237,6 @@ TCConfigEntry lavcopts_conf[]={
- {"skip_top", &lavc_param_skip_top, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 1000},
- {"skip_bottom", &lavc_param_skip_bottom, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 1000},
- {"fps_code", &lavc_param_fps_code, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 9},
-- {"vpre", &lavc_param_video_preset, TCCONF_TYPE_STRING, 0, 0, 0},
- {"ffmpeg_datadir", &lavc_param_ffmpeg_datadir, TCCONF_TYPE_STRING, 0, 0, 0},
- {NULL, NULL, 0, 0, 0, 0}
- };
diff --git a/extra/transcode/PKGBUILD b/extra/transcode/PKGBUILD
index eb2219d56..5f3a9928d 100644
--- a/extra/transcode/PKGBUILD
+++ b/extra/transcode/PKGBUILD
@@ -1,4 +1,4 @@
-# $Id: PKGBUILD 192481 2013-08-12 20:25:48Z eric $
+# $Id: PKGBUILD 194278 2013-09-12 20:45:23Z eric $
# Maintainer:
# Contributor: Sarah Hay <sarahhay@mb.sympatico.ca>
# Contributor: roberto <roberto@archlinux.org>
@@ -6,7 +6,7 @@
pkgname=transcode
_sripver=0.3-4
pkgver=1.1.7
-pkgrel=11
+pkgrel=12
pkgdesc="A video/DVD ripper and encoder for the terminal/console"
arch=('i686' 'x86_64')
url="http://tcforge.berlios.de/"
@@ -17,23 +17,36 @@ makedepends=('nasm')
options=('!libtool')
source=(https://bitbucket.org/france/transcode-tcforge/downloads/${pkgname}-${pkgver}.tar.bz2
http://downloads.sourceforge.net/sourceforge/subtitleripper/subtitleripper-${_sripver}.tgz
- subtitleripper-0.3.4-linkingorder.patch subtitleripper-0.3.4-respect-ldflags.patch
- ffmpeg-0.11.patch transcode-1.1.7-libav-9.patch 04_ffmpeg_options.patch transcode-ffmpeg.patch)
+ subtitleripper-0.3.4-linkingorder.patch
+ subtitleripper-0.3.4-respect-ldflags.patch
+ transcode-1.1.7-ffmpeg.patch
+ transcode-1.1.7-ffmpeg-0.10.patch
+ transcode-1.1.7-ffmpeg-0.11.patch
+ transcode-1.1.7-preset-free.patch
+ transcode-1.1.7-libav-9.patch
+ transcode-1.1.7-preset-force.patch
+ transcode-1.1.7-ffmpeg2.patch)
sha1sums=('e35df68b960eb56ef0a59a4cdbed1491be56aee6'
'd93ff3578dd5f722c8f4ef16bc0903eec5781a0d'
'fa05aa1770d9350d90b7cf315aa7c4a1fd921ac7'
'591943a33235342a66c3df0625a164a1479c09ae'
- '3d2dcdc23f14938e87d14cfc03000bb3b649b85e'
+ 'cc81c190db51d8a64623e2eea3b327ec7eb7ec57'
+ '3b1590f30f8f32350444f668584ec31be6e8e614'
+ '3f7b0257f023df6ea249111d247a852c46261c2f'
+ '54b1bab48a0b3bc0e8464c4deb4de31bf1060a1c'
'ef1cccd35317d3a28443b654da49de731cdf1766'
- '00938db9aebde719799c11116ed9fe85a9cc4bdd'
- '6d1774e202cca689c4e417def982452990b8e7e4')
+ '034853427bc784a80b333d2e2f4bab44f0b86ce0'
+ '764de67996e2c4947346c7a91586cc4ca826a8e2')
prepare() {
cd ${pkgname}-${pkgver}
- patch -p1 -i "${srcdir}/ffmpeg-0.11.patch"
+ patch -p0 -i "${srcdir}/transcode-1.1.7-ffmpeg.patch"
+ patch -p0 -i "${srcdir}/transcode-1.1.7-ffmpeg-0.10.patch"
+ patch -p1 -i "${srcdir}/transcode-1.1.7-ffmpeg-0.11.patch"
+ patch -p1 -i "${srcdir}/transcode-1.1.7-preset-free.patch"
patch -p0 -i "${srcdir}/transcode-1.1.7-libav-9.patch"
- patch -p1 -i "${srcdir}/04_ffmpeg_options.patch"
- patch -p1 -i "${srcdir}/transcode-ffmpeg.patch"
+ patch -p1 -i "${srcdir}/transcode-1.1.7-preset-force.patch"
+ patch -p1 -i "${srcdir}/transcode-1.1.7-ffmpeg2.patch"
cd ../subtitleripper
patch -p1 -i "${srcdir}/subtitleripper-0.3.4-linkingorder.patch"
diff --git a/extra/transcode/ffmpeg-0.11.patch b/extra/transcode/ffmpeg-0.11.patch
deleted file mode 100644
index b5601fe2f..000000000
--- a/extra/transcode/ffmpeg-0.11.patch
+++ /dev/null
@@ -1,141 +0,0 @@
-diff -Naur transcode-1.1.7/export/export_ffmpeg.c fixed-tc/export/export_ffmpeg.c
---- transcode-1.1.7/export/export_ffmpeg.c 2011-11-19 11:50:27.000000000 -0500
-+++ fixed-tc/export/export_ffmpeg.c 2012-07-05 16:22:41.095346080 -0400
-@@ -180,7 +180,7 @@
-
-
- /* START: COPIED FROM ffmpeg-0.5_p22846(ffmpeg.c, cmdutils.c) */
--#include <libavcodec/opt.h>
-+#include <libavutil/opt.h>
- #include <libavutil/avstring.h>
- #include <libswscale/swscale.h>
-
-@@ -470,7 +470,6 @@
- }
-
- TC_LOCK_LIBAVCODEC;
-- avcodec_init();
- avcodec_register_all();
- TC_UNLOCK_LIBAVCODEC;
-
-@@ -634,7 +633,6 @@
- lavc_param_rc_max_rate = 2516;
- lavc_param_rc_buffer_size = 224 * 8;
- lavc_param_rc_buffer_aggressivity = 99;
-- lavc_param_scan_offset = CODEC_FLAG_SVCD_SCAN_OFFSET;
-
- break;
-
-@@ -674,7 +673,6 @@
-
- lavc_param_rc_buffer_size = 224 * 8;
- lavc_param_rc_buffer_aggressivity = 99;
-- lavc_param_scan_offset = CODEC_FLAG_SVCD_SCAN_OFFSET;
-
- break;
-
-diff -Naur transcode-1.1.7/export/ffmpeg_cfg.c fixed-tc/export/ffmpeg_cfg.c
---- transcode-1.1.7/export/ffmpeg_cfg.c 2011-11-19 11:50:27.000000000 -0500
-+++ fixed-tc/export/ffmpeg_cfg.c 2012-07-05 15:26:29.112103273 -0400
-@@ -160,9 +160,7 @@
- {"vcelim", &lavc_param_chroma_elim_threshold, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -99, 99},
- {"vpsize", &lavc_param_packet_size, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 100000000},
- {"vstrict", &lavc_param_strict, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -99, 99},
-- {"vdpart", &lavc_param_data_partitioning, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_PART},
- // {"keyint", &lavc_param_keyint, TCCONF_TYPE_INT, 0, 0, 0},
-- {"gray", &lavc_param_gray, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_PART},
- {"mpeg_quant", &lavc_param_mpeg_quant, TCCONF_TYPE_FLAG, 0, 0, 1},
- {"vi_qfactor", &lavc_param_vi_qfactor, TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, -31.0, 31.0},
- {"vi_qoffset", &lavc_param_vi_qoffset, TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 31.0},
-@@ -211,7 +211,6 @@
- #else
- {"aic", &lavc_param_aic, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_AC_PRED},
- #endif
-- {"umv", &lavc_param_umv, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_H263P_UMV},
- {"ibias", &lavc_param_ibias, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -512, 512},
- {"pbias", &lavc_param_pbias, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -512, 512},
- {"coder", &lavc_param_coder, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 10},
-@@ -223,9 +223,6 @@
- {"nr", &lavc_param_noise_reduction, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 1000000},
- {"qprd", &lavc_param_qp_rd, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_QP_RD},
- {"threads", &lavc_param_threads, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 16},
-- {"ss", &lavc_param_ss, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_H263P_SLICE_STRUCT},
-- {"svcd_sof", &lavc_param_scan_offset, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_SVCD_SCAN_OFFSET},
-- {"alt", &lavc_param_alt, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_ALT_SCAN},
- {"ilme", &lavc_param_ilme, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_INTERLACED_ME},
- {"inter_threshold", &lavc_param_inter_threshold, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -1000000, 1000000},
- {"sc_threshold", &lavc_param_sc_threshold, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -1000000, 1000000},
-diff -Naur transcode-1.1.7/filter/filter_pp.c fixed-tc/filter/filter_pp.c
---- transcode-1.1.7/filter/filter_pp.c 2011-11-19 11:50:27.000000000 -0500
-+++ fixed-tc/filter/filter_pp.c 2012-07-05 15:26:28.945436613 -0400
-@@ -38,8 +38,8 @@
-
- /* FIXME: these use the filter ID as an index--the ID can grow
- * arbitrarily large, so this needs to be fixed */
--static pp_mode_t *mode[100];
--static pp_context_t *context[100];
-+static pp_mode *mode[100];
-+static pp_context *context[100];
- static int width[100], height[100];
- static int pre[100];
-
-diff -Naur transcode-1.1.7/import/decode_lavc.c fixed-tc/import/decode_lavc.c
---- transcode-1.1.7/import/decode_lavc.c 2011-11-19 11:50:27.000000000 -0500
-+++ fixed-tc/import/decode_lavc.c 2012-07-05 15:26:28.842103278 -0400
-@@ -181,7 +181,7 @@
- #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
- lavc_dec_context->error_resilience = 2;
- #else
-- lavc_dec_context->error_recognition = 2;
-+ lavc_dec_context->err_recognition = 2;
- #endif
- lavc_dec_context->error_concealment = 3;
- lavc_dec_context->workaround_bugs = FF_BUG_AUTODETECT;
-diff -Naur transcode-1.1.7/import/import_ffmpeg.c fixed-tc/import/import_ffmpeg.c
---- transcode-1.1.7/import/import_ffmpeg.c 2011-11-19 11:50:27.000000000 -0500
-+++ fixed-tc/import/import_ffmpeg.c 2012-07-05 15:26:28.848769946 -0400
-@@ -314,7 +314,7 @@
- #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
- lavc_dec_context->error_resilience = 2;
- #else
-- lavc_dec_context->error_recognition = 2;
-+ lavc_dec_context->err_recognition = 2;
- #endif
- lavc_dec_context->error_concealment = 3;
- lavc_dec_context->workaround_bugs = FF_BUG_AUTODETECT;
-diff -Naur transcode-1.1.7/import/probe_ffmpeg.c fixed-tc/import/probe_ffmpeg.c
---- transcode-1.1.7/import/probe_ffmpeg.c 2011-11-19 11:50:27.000000000 -0500
-+++ fixed-tc/import/probe_ffmpeg.c 2012-07-05 15:26:28.838769947 -0400
-@@ -99,8 +99,8 @@
-
- TC_INIT_LIBAVCODEC;
-
-- ret = av_open_input_file(&lavf_dmx_context, ipipe->name,
-- NULL, 0, NULL);
-+ ret = avformat_open_input(&lavf_dmx_context, ipipe->name,
-+ NULL, NULL);
- if (ret != 0) {
- tc_log_error(__FILE__, "unable to open '%s'"
- " (libavformat failure)",
-diff -Naur transcode-1.1.7/libtc/tcavcodec.h fixed-tc/libtc/tcavcodec.h
---- transcode-1.1.7/libtc/tcavcodec.h 2011-11-19 11:50:27.000000000 -0500
-+++ fixed-tc/libtc/tcavcodec.h 2012-07-05 15:26:28.828769951 -0400
-@@ -53,7 +53,6 @@
-
- #define TC_INIT_LIBAVCODEC do { \
- TC_LOCK_LIBAVCODEC; \
-- avcodec_init(); \
- avcodec_register_all(); \
- TC_UNLOCK_LIBAVCODEC; \
- } while (0)
---- transcode-1.1.7/export/export_ffmpeg.c.orig 2012-10-19 23:25:16.442303175 -0400
-+++ transcode-1.1.7/export/export_ffmpeg.c 2012-10-19 23:26:23.904268733 -0400
-@@ -1249,7 +1249,7 @@
- return TC_EXPORT_ERROR;
- }
-
-- if (lavc_venc_context->codec->encode == NULL) {
-+ if (lavc_venc_context->codec->encode2 == NULL) {
- tc_log_warn(MOD_NAME, "could not open FFMPEG codec "
- "(lavc_venc_context->codec->encode == NULL)");
- return TC_EXPORT_ERROR;
diff --git a/extra/transcode/transcode-1.1.7-ffmpeg-0.10.patch b/extra/transcode/transcode-1.1.7-ffmpeg-0.10.patch
new file mode 100644
index 000000000..ea737c8b0
--- /dev/null
+++ b/extra/transcode/transcode-1.1.7-ffmpeg-0.10.patch
@@ -0,0 +1,15 @@
+http://bugs.gentoo.org/401287
+
+--- filter/filter_pp.c
++++ filter/filter_pp.c
+@@ -38,8 +38,8 @@
+
+ /* FIXME: these use the filter ID as an index--the ID can grow
+ * arbitrarily large, so this needs to be fixed */
+-static pp_mode_t *mode[100];
+-static pp_context_t *context[100];
++static pp_mode *mode[100];
++static pp_context *context[100];
+ static int width[100], height[100];
+ static int pre[100];
+
diff --git a/extra/transcode/transcode-1.1.7-ffmpeg-0.11.patch b/extra/transcode/transcode-1.1.7-ffmpeg-0.11.patch
new file mode 100644
index 000000000..871d073fe
--- /dev/null
+++ b/extra/transcode/transcode-1.1.7-ffmpeg-0.11.patch
@@ -0,0 +1,303 @@
+Fix build with ffmpeg 0.11.
+https://bugs.gentoo.org/show_bug.cgi?id=419551
+Author: Brennan Shacklett
+
+diff -urN transcode-1.1.7-orig/encode/encode_lavc.c transcode-1.1.7/encode/encode_lavc.c
+--- transcode-1.1.7-orig/encode/encode_lavc.c 2011-11-19 08:50:27.000000000 -0800
++++ transcode-1.1.7/encode/encode_lavc.c 2012-07-03 10:47:03.528009149 -0700
+@@ -114,6 +114,7 @@
+
+ AVFrame ff_venc_frame;
+ AVCodecContext ff_vcontext;
++ AVDictionary ** ff_opts;
+
+ AVCodec *ff_vcodec;
+
+@@ -1036,14 +1037,10 @@
+ SET_FLAG(pd, mv0);
+ SET_FLAG(pd, cbp);
+ SET_FLAG(pd, qpel);
+- SET_FLAG(pd, alt);
+- SET_FLAG(pd, vdpart);
+ SET_FLAG(pd, naq);
+ SET_FLAG(pd, ilme);
+ SET_FLAG(pd, ildct);
+ SET_FLAG(pd, aic);
+- SET_FLAG(pd, aiv);
+- SET_FLAG(pd, umv);
+ SET_FLAG(pd, psnr);
+ SET_FLAG(pd, trell);
+ SET_FLAG(pd, gray);
+@@ -1064,6 +1061,18 @@
+ pd->ff_vcontext.flags |= CODEC_FLAG_INTERLACED_DCT;
+ pd->ff_vcontext.flags |= CODEC_FLAG_INTERLACED_ME;
+ }
++ if (pd->confdata.flags.alt) {
++ av_dict_set(pd->ff_opts, "alternate_scan", "1", 0);
++ }
++ if (pd->confdata.flags.vdpart) {
++ av_dict_set(pd->ff_opts, "data_partitioning", "1", 0);
++ }
++ if (pd->confdata.flags.umv) {
++ av_dict_set(pd->ff_opts, "umv", "1", 0);
++ }
++ if (pd->confdata.flags.aiv) {
++ av_dict_set(pd->ff_opts, "aiv", "1", 0);
++ }
+ }
+
+ #undef SET_FLAG
+@@ -1184,18 +1193,18 @@
+ { "mv0", PAUX(flags.mv0), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_MV0 },
+ { "cbp", PAUX(flags.cbp), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_CBP_RD },
+ { "qpel", PAUX(flags.qpel), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_QPEL },
+- { "alt", PAUX(flags.alt), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_ALT_SCAN },
++ { "alt", PAUX(flags.alt), TCCONF_TYPE_FLAG, 0, 0, 1 },
+ { "ilme", PAUX(flags.ilme), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_INTERLACED_ME },
+ { "ildct", PAUX(flags.ildct), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_INTERLACED_DCT },
+ { "naq", PAUX(flags.naq), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_NORMALIZE_AQP },
+- { "vdpart", PAUX(flags.vdpart), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_PART },
++ { "vdpart", PAUX(flags.vdpart), TCCONF_TYPE_FLAG, 0, 0, 1 },
+ #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
+ { "aic", PAUX(flags.aic), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_H263P_AIC },
+ #else
+ { "aic", PAUX(flags.aic), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_AC_PRED },
+ #endif
+- { "aiv", PAUX(flags.aiv), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_H263P_AIV },
+- { "umv", PAUX(flags.umv), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_H263P_UMV },
++ { "aiv", PAUX(flags.aiv), TCCONF_TYPE_FLAG, 0, 0, 1 },
++ { "umv", PAUX(flags.umv), TCCONF_TYPE_FLAG, 0, 0, 1 },
+ { "psnr", PAUX(flags.psnr), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_PSNR },
+ #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
+ { "trell", PAUX(flags.trell), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_TRELLIS_QUANT },
+@@ -1387,7 +1396,7 @@
+ pd->confdata.thread_count,
+ (pd->confdata.thread_count > 1) ?"s" :"");
+ }
+- avcodec_thread_init(&pd->ff_vcontext, pd->confdata.thread_count);
++ pd->ff_vcontext.thread_count = pd->confdata.thread_count;
+
+ pd->ff_vcodec = avcodec_find_encoder(FF_VCODEC_ID(pd));
+ if (pd->ff_vcodec == NULL) {
+@@ -1397,11 +1406,11 @@
+ }
+
+ TC_LOCK_LIBAVCODEC;
+- ret = avcodec_open(&pd->ff_vcontext, pd->ff_vcodec);
++ ret = avcodec_open2(&pd->ff_vcontext, pd->ff_vcodec, pd->ff_opts);
+ TC_UNLOCK_LIBAVCODEC;
+
+ if (ret < 0) {
+- tc_log_error(MOD_NAME, "avcodec_open() failed");
++ tc_log_error(MOD_NAME, "avcodec_open2() failed");
+ goto failed;
+ }
+ /* finally, pass up the extradata, if any */
+diff -urN transcode-1.1.7-orig/export/export_ffmpeg.c transcode-1.1.7/export/export_ffmpeg.c
+--- transcode-1.1.7-orig/export/export_ffmpeg.c 2011-11-19 08:50:27.000000000 -0800
++++ transcode-1.1.7/export/export_ffmpeg.c 2012-07-03 13:15:23.918019415 -0700
+@@ -122,6 +122,7 @@
+ static AVFrame *lavc_convert_frame = NULL;
+
+ static AVCodec *lavc_venc_codec = NULL;
++static AVDictionary **lavc_venc_opts = NULL;
+ static AVFrame *lavc_venc_frame = NULL;
+ static AVCodecContext *lavc_venc_context;
+ static avi_t *avifile = NULL;
+@@ -180,7 +181,7 @@
+
+
+ /* START: COPIED FROM ffmpeg-0.5_p22846(ffmpeg.c, cmdutils.c) */
+-#include <libavcodec/opt.h>
++#include <libavutil/opt.h>
+ #include <libavutil/avstring.h>
+ #include <libswscale/swscale.h>
+
+@@ -470,7 +471,6 @@
+ }
+
+ TC_LOCK_LIBAVCODEC;
+- avcodec_init();
+ avcodec_register_all();
+ TC_UNLOCK_LIBAVCODEC;
+
+@@ -634,7 +634,7 @@
+ lavc_param_rc_max_rate = 2516;
+ lavc_param_rc_buffer_size = 224 * 8;
+ lavc_param_rc_buffer_aggressivity = 99;
+- lavc_param_scan_offset = CODEC_FLAG_SVCD_SCAN_OFFSET;
++ lavc_param_scan_offset = 1;
+
+ break;
+
+@@ -674,7 +674,7 @@
+
+ lavc_param_rc_buffer_size = 224 * 8;
+ lavc_param_rc_buffer_aggressivity = 99;
+- lavc_param_scan_offset = CODEC_FLAG_SVCD_SCAN_OFFSET;
++ lavc_param_scan_offset = 1;
+
+ break;
+
+@@ -887,7 +887,7 @@
+ lavc_venc_context->thread_count);
+ }
+
+- avcodec_thread_init(lavc_venc_context, lavc_param_threads);
++ lavc_venc_context->thread_count = lavc_param_threads;
+
+ if (lavc_param_intra_matrix) {
+ char *tmp;
+@@ -1065,15 +1065,10 @@
+ lavc_venc_context->flags |= lavc_param_closedgop;
+ lavc_venc_context->flags |= lavc_param_trunc;
+ lavc_venc_context->flags |= lavc_param_aic;
+- lavc_venc_context->flags |= lavc_param_umv;
+ lavc_venc_context->flags |= lavc_param_v4mv;
+- lavc_venc_context->flags |= lavc_param_data_partitioning;
+ lavc_venc_context->flags |= lavc_param_cbp;
+ lavc_venc_context->flags |= lavc_param_mv0;
+ lavc_venc_context->flags |= lavc_param_qp_rd;
+- lavc_venc_context->flags |= lavc_param_scan_offset;
+- lavc_venc_context->flags |= lavc_param_ss;
+- lavc_venc_context->flags |= lavc_param_alt;
+ lavc_venc_context->flags |= lavc_param_ilme;
+ #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
+ lavc_venc_context->flags |= lavc_param_trell;
+@@ -1203,7 +1198,6 @@
+
+ lavc_venc_context->me_method = ME_ZERO + lavc_param_vme;
+
+-
+ /* FIXME: transcode itself contains "broken ffmpeg default settings", thus we need to override them! */
+ if (lavc_param_video_preset) {
+ avcodec_opts[AVMEDIA_TYPE_VIDEO] = lavc_venc_context;
+@@ -1241,20 +1235,39 @@
+ }
+ }
+
++ if (lavc_param_scan_offset) {
++ av_dict_set(lavc_venc_opts, "scan_offset", "1", 0);
++ }
++
++ if (lavc_param_ss) {
++ av_dict_set(lavc_venc_opts, "structured_slices", "1", 0);
++ }
++
++ if (lavc_param_alt) {
++ av_dict_set(lavc_venc_opts, "alternate_scan", "1", 0);
++ }
++
++ if (lavc_param_umv) {
++ av_dict_set(lavc_venc_opts, "umv", "1", 0);
++ }
++
++ if (lavc_param_data_partitioning) {
++ av_dict_set(lavc_venc_opts, "vdpart", "1", 0);
++ }
+
+ //-- open codec --
+ //----------------
+ TC_LOCK_LIBAVCODEC;
+- ret = avcodec_open(lavc_venc_context, lavc_venc_codec);
++ ret = avcodec_open2(lavc_venc_context, lavc_venc_codec, lavc_venc_opts);
+ TC_UNLOCK_LIBAVCODEC;
+ if (ret < 0) {
+ tc_log_warn(MOD_NAME, "could not open FFMPEG codec");
+ return TC_EXPORT_ERROR;
+ }
+
+- if (lavc_venc_context->codec->encode == NULL) {
++ if (av_codec_is_encoder(lavc_venc_context->codec) == 0) {
+ tc_log_warn(MOD_NAME, "could not open FFMPEG codec "
+- "(lavc_venc_context->codec->encode == NULL)");
++ "(av_codec_is_encoder(lavc_venc_context->codec) == 0)");
+ return TC_EXPORT_ERROR;
+ }
+
+diff -urN transcode-1.1.7-orig/export/ffmpeg_cfg.c transcode-1.1.7/export/ffmpeg_cfg.c
+--- transcode-1.1.7-orig/export/ffmpeg_cfg.c 2011-11-19 08:50:27.000000000 -0800
++++ transcode-1.1.7/export/ffmpeg_cfg.c 2012-07-03 10:09:25.011003254 -0700
+@@ -160,9 +160,9 @@
+ {"vcelim", &lavc_param_chroma_elim_threshold, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -99, 99},
+ {"vpsize", &lavc_param_packet_size, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 100000000},
+ {"vstrict", &lavc_param_strict, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -99, 99},
+- {"vdpart", &lavc_param_data_partitioning, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_PART},
++ {"vdpart", &lavc_param_data_partitioning, TCCONF_TYPE_FLAG, 0, 0, 1},
+ // {"keyint", &lavc_param_keyint, TCCONF_TYPE_INT, 0, 0, 0},
+- {"gray", &lavc_param_gray, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_PART},
++ {"gray", &lavc_param_gray, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_GRAY},
+ {"mpeg_quant", &lavc_param_mpeg_quant, TCCONF_TYPE_FLAG, 0, 0, 1},
+ {"vi_qfactor", &lavc_param_vi_qfactor, TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, -31.0, 31.0},
+ {"vi_qoffset", &lavc_param_vi_qoffset, TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 31.0},
+@@ -211,7 +211,7 @@
+ #else
+ {"aic", &lavc_param_aic, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_AC_PRED},
+ #endif
+- {"umv", &lavc_param_umv, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_H263P_UMV},
++ {"umv", &lavc_param_umv, TCCONF_TYPE_FLAG, 0, 0, 1},
+ {"ibias", &lavc_param_ibias, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -512, 512},
+ {"pbias", &lavc_param_pbias, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -512, 512},
+ {"coder", &lavc_param_coder, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 10},
+@@ -223,9 +223,9 @@
+ {"nr", &lavc_param_noise_reduction, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 1000000},
+ {"qprd", &lavc_param_qp_rd, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_QP_RD},
+ {"threads", &lavc_param_threads, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 16},
+- {"ss", &lavc_param_ss, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_H263P_SLICE_STRUCT},
+- {"svcd_sof", &lavc_param_scan_offset, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_SVCD_SCAN_OFFSET},
+- {"alt", &lavc_param_alt, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_ALT_SCAN},
++ {"ss", &lavc_param_ss, TCCONF_TYPE_FLAG, 0, 0, 1},
++ {"svcd_sof", &lavc_param_scan_offset, TCCONF_TYPE_FLAG, 0, 0, 1},
++ {"alt", &lavc_param_alt, TCCONF_TYPE_FLAG, 0, 0, 1},
+ {"ilme", &lavc_param_ilme, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_INTERLACED_ME},
+ {"inter_threshold", &lavc_param_inter_threshold, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -1000000, 1000000},
+ {"sc_threshold", &lavc_param_sc_threshold, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -1000000, 1000000},
+diff -urN transcode-1.1.7-orig/import/decode_lavc.c transcode-1.1.7/import/decode_lavc.c
+--- transcode-1.1.7-orig/import/decode_lavc.c 2011-11-19 08:50:27.000000000 -0800
++++ transcode-1.1.7/import/decode_lavc.c 2012-07-03 10:21:46.085005182 -0700
+@@ -181,7 +181,7 @@
+ #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
+ lavc_dec_context->error_resilience = 2;
+ #else
+- lavc_dec_context->error_recognition = 2;
++ lavc_dec_context->err_recognition = 2;
+ #endif
+ lavc_dec_context->error_concealment = 3;
+ lavc_dec_context->workaround_bugs = FF_BUG_AUTODETECT;
+diff -urN transcode-1.1.7-orig/import/import_ffmpeg.c transcode-1.1.7/import/import_ffmpeg.c
+--- transcode-1.1.7-orig/import/import_ffmpeg.c 2011-11-19 08:50:27.000000000 -0800
++++ transcode-1.1.7/import/import_ffmpeg.c 2012-07-03 10:19:36.936004841 -0700
+@@ -314,7 +314,7 @@
+ #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
+ lavc_dec_context->error_resilience = 2;
+ #else
+- lavc_dec_context->error_recognition = 2;
++ lavc_dec_context->err_recognition = 2;
+ #endif
+ lavc_dec_context->error_concealment = 3;
+ lavc_dec_context->workaround_bugs = FF_BUG_AUTODETECT;
+diff -urN transcode-1.1.7-orig/import/probe_ffmpeg.c transcode-1.1.7/import/probe_ffmpeg.c
+--- transcode-1.1.7-orig/import/probe_ffmpeg.c 2011-11-19 08:50:27.000000000 -0800
++++ transcode-1.1.7/import/probe_ffmpeg.c 2012-07-03 10:41:42.782008306 -0700
+@@ -99,8 +99,8 @@
+
+ TC_INIT_LIBAVCODEC;
+
+- ret = av_open_input_file(&lavf_dmx_context, ipipe->name,
+- NULL, 0, NULL);
++ ret = avformat_open_input(&lavf_dmx_context, ipipe->name,
++ NULL, NULL);
+ if (ret != 0) {
+ tc_log_error(__FILE__, "unable to open '%s'"
+ " (libavformat failure)",
+diff -urN transcode-1.1.7-orig/libtc/tcavcodec.h transcode-1.1.7/libtc/tcavcodec.h
+--- transcode-1.1.7-orig/libtc/tcavcodec.h 2011-11-19 08:50:27.000000000 -0800
++++ transcode-1.1.7/libtc/tcavcodec.h 2012-07-03 10:34:43.648007213 -0700
+@@ -53,7 +53,6 @@
+
+ #define TC_INIT_LIBAVCODEC do { \
+ TC_LOCK_LIBAVCODEC; \
+- avcodec_init(); \
+ avcodec_register_all(); \
+ TC_UNLOCK_LIBAVCODEC; \
+ } while (0)
diff --git a/extra/transcode/transcode-1.1.7-ffmpeg.patch b/extra/transcode/transcode-1.1.7-ffmpeg.patch
new file mode 100644
index 000000000..be7a6cbae
--- /dev/null
+++ b/extra/transcode/transcode-1.1.7-ffmpeg.patch
@@ -0,0 +1,51 @@
+--- encode/encode_lavc.c
++++ encode/encode_lavc.c
+@@ -955,8 +955,6 @@
+ /*
+ * context *transcode* (not libavcodec) defaults
+ */
+- pd->ff_vcontext.mb_qmin = 2;
+- pd->ff_vcontext.mb_qmax = 31;
+ pd->ff_vcontext.max_qdiff = 3;
+ pd->ff_vcontext.max_b_frames = 0;
+ pd->ff_vcontext.me_range = 0;
+@@ -1116,8 +1114,6 @@
+ // handled by transcode core
+ // { "vqmax", PCTX(qmax), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 60 },
+ // handled by transcode core
+- { "mbqmin", PCTX(mb_qmin), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 60 },
+- { "mbqmax", PCTX(mb_qmax), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 60 },
+ { "lmin", PAUX(lmin), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.01, 255.0 },
+ { "lmax", PAUX(lmax), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.01, 255.0 },
+ { "vqdiff", PCTX(max_qdiff), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 31 },
+--- export/ffmpeg_cfg.c
++++ export/ffmpeg_cfg.c
+@@ -34,8 +34,6 @@
+ //int lavc_param_vqscale = 0;
+ //int lavc_param_vqmin = 2;
+ //int lavc_param_vqmax = 31;
+-int lavc_param_mb_qmin = 2;
+-int lavc_param_mb_qmax = 31;
+ int lavc_param_lmin = 2;
+ int lavc_param_lmax = 31;
+ int lavc_param_vqdiff = 3;
+@@ -143,8 +141,6 @@
+ // {"vqscale", &lavc_param_vqscale, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 31},
+ // {"vqmin", &lavc_param_vqmin, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 31},
+ // {"vqmax", &lavc_param_vqmax, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 31},
+- {"mbqmin", &lavc_param_mb_qmin, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 31},
+- {"mbqmax", &lavc_param_mb_qmax, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 31},
+ {"lmin", &lavc_param_lmin, TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.01, 255.0},
+ {"lmax", &lavc_param_lmax, TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.01, 255.0},
+ {"vqdiff", &lavc_param_vqdiff, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 31},
+--- export/ffmpeg_cfg.h
++++ export/ffmpeg_cfg.h
+@@ -13,8 +13,6 @@
+ //extern int lavc_param_vqscale;
+ //extern int lavc_param_vqmin;
+ //extern int lavc_param_vqmax;
+-extern int lavc_param_mb_qmin;
+-extern int lavc_param_mb_qmax;
+ extern int lavc_param_lmin;
+ extern int lavc_param_lmax;
+ extern int lavc_param_vqdiff;
diff --git a/extra/transcode/transcode-1.1.7-ffmpeg2.patch b/extra/transcode/transcode-1.1.7-ffmpeg2.patch
new file mode 100644
index 000000000..26d743140
--- /dev/null
+++ b/extra/transcode/transcode-1.1.7-ffmpeg2.patch
@@ -0,0 +1,332 @@
+Fix build with ffmpeg-2.0.
+Fix segfaults introduced by wrong usage of the av_dict API.
+Fix forgotten parts in the libav9 patch.
+
+Index: transcode-1.1.7/encode/encode_lavc.c
+===================================================================
+--- transcode-1.1.7.orig/encode/encode_lavc.c
++++ transcode-1.1.7/encode/encode_lavc.c
+@@ -74,6 +74,9 @@ struct tclavcconfigdata_ {
+ int lmin;
+ int lmax;
+ int me_method;
++ int luma_elim_threshold;
++ int chroma_elim_threshold;
++ int quantizer_noise_shaping;
+
+ /* same as above for flags */
+ struct {
+@@ -114,7 +117,7 @@ struct tclavcprivatedata_ {
+
+ AVFrame ff_venc_frame;
+ AVCodecContext ff_vcontext;
+- AVDictionary ** ff_opts;
++ AVDictionary * ff_opts;
+
+ AVCodec *ff_vcodec;
+
+@@ -165,6 +168,7 @@ static const TCCodecID tc_lavc_codecs_ou
+ TC_CODEC_ERROR
+ };
+
++#if LIBAVCODEC_VERSION_MAJOR < 55
+ static const enum CodecID tc_lavc_internal_codecs[] = {
+ CODEC_ID_MPEG1VIDEO, CODEC_ID_MPEG2VIDEO, CODEC_ID_MPEG4,
+ CODEC_ID_H263I, CODEC_ID_H263P,
+@@ -177,6 +181,20 @@ static const enum CodecID tc_lavc_intern
+ CODEC_ID_MSMPEG4V2, CODEC_ID_MSMPEG4V3,
+ CODEC_ID_NONE
+ };
++#else
++static const enum AVCodecID tc_lavc_internal_codecs[] = {
++ AV_CODEC_ID_MPEG1VIDEO, AV_CODEC_ID_MPEG2VIDEO, AV_CODEC_ID_MPEG4,
++ AV_CODEC_ID_H263I, AV_CODEC_ID_H263P,
++ AV_CODEC_ID_H264,
++ AV_CODEC_ID_WMV1, AV_CODEC_ID_WMV2,
++ AV_CODEC_ID_RV10,
++ AV_CODEC_ID_HUFFYUV, AV_CODEC_ID_FFV1,
++ AV_CODEC_ID_DVVIDEO,
++ AV_CODEC_ID_MJPEG, AV_CODEC_ID_LJPEG,
++ AV_CODEC_ID_MSMPEG4V2, AV_CODEC_ID_MSMPEG4V3,
++ AV_CODEC_ID_NONE
++};
++#endif
+
+ static const TCFormatID tc_lavc_formats[] = { TC_FORMAT_ERROR };
+
+@@ -938,7 +956,11 @@ static int tc_lavc_settings_from_vob(TCL
+ static void tc_lavc_config_defaults(TCLavcPrivateData *pd)
+ {
+ /* first of all reinitialize lavc data */
++#if LIBAVCODEC_VERSION_MAJOR < 55
+ avcodec_get_context_defaults(&pd->ff_vcontext);
++#else
++ avcodec_get_context_defaults3(&pd->ff_vcontext, NULL);
++#endif
+
+ pd->confdata.thread_count = 1;
+
+@@ -976,8 +998,8 @@ static void tc_lavc_config_defaults(TCLa
+ pd->ff_vcontext.mpeg_quant = 0;
+ pd->ff_vcontext.rc_initial_cplx = 0.0;
+ pd->ff_vcontext.rc_qsquish = 1.0;
+- pd->ff_vcontext.luma_elim_threshold = 0;
+- pd->ff_vcontext.chroma_elim_threshold = 0;
++ pd->confdata.luma_elim_threshold = 0;
++ pd->confdata.chroma_elim_threshold = 0;
+ pd->ff_vcontext.strict_std_compliance = 0;
+ pd->ff_vcontext.dct_algo = FF_DCT_AUTO;
+ pd->ff_vcontext.idct_algo = FF_IDCT_AUTO;
+@@ -1001,7 +1023,7 @@ static void tc_lavc_config_defaults(TCLa
+ pd->ff_vcontext.intra_quant_bias = FF_DEFAULT_QUANT_BIAS;
+ pd->ff_vcontext.inter_quant_bias = FF_DEFAULT_QUANT_BIAS;
+ pd->ff_vcontext.noise_reduction = 0;
+- pd->ff_vcontext.quantizer_noise_shaping = 0;
++ pd->confdata.quantizer_noise_shaping = 0;
+ pd->ff_vcontext.flags = 0;
+ }
+
+@@ -1033,7 +1055,6 @@ static void tc_lavc_dispatch_settings(TC
+
+ pd->ff_vcontext.flags = 0;
+ SET_FLAG(pd, mv0);
+- SET_FLAG(pd, cbp);
+ SET_FLAG(pd, qpel);
+ SET_FLAG(pd, naq);
+ SET_FLAG(pd, ilme);
+@@ -1060,17 +1081,29 @@ static void tc_lavc_dispatch_settings(TC
+ pd->ff_vcontext.flags |= CODEC_FLAG_INTERLACED_ME;
+ }
+ if (pd->confdata.flags.alt) {
+- av_dict_set(pd->ff_opts, "alternate_scan", "1", 0);
++ av_dict_set(&(pd->ff_opts), "alternate_scan", "1", 0);
+ }
+ if (pd->confdata.flags.vdpart) {
+- av_dict_set(pd->ff_opts, "data_partitioning", "1", 0);
++ av_dict_set(&(pd->ff_opts), "data_partitioning", "1", 0);
+ }
+ if (pd->confdata.flags.umv) {
+- av_dict_set(pd->ff_opts, "umv", "1", 0);
++ av_dict_set(&(pd->ff_opts), "umv", "1", 0);
+ }
+ if (pd->confdata.flags.aiv) {
+- av_dict_set(pd->ff_opts, "aiv", "1", 0);
++ av_dict_set(&(pd->ff_opts), "aiv", "1", 0);
+ }
++ if (pd->confdata.flags.cbp) {
++ av_dict_set(&(pd->ff_opts), "mpv_flags", "+cbp_rd", 0);
++ }
++
++ char buf[1024];
++#define set_dict_opt(val, opt) \
++ snprintf(buf, sizeof(buf), "%i", pd->confdata.val);\
++ av_dict_set(&(pd->ff_opts), opt, buf, 0)
++
++ set_dict_opt(luma_elim_threshold, "luma_elim_threshold");
++ set_dict_opt(chroma_elim_threshold, "chroma_elim_threshold");
++ set_dict_opt(quantizer_noise_shaping, "quantizer_noise_shaping");
+ }
+
+ #undef SET_FLAG
+@@ -1155,8 +1188,8 @@ static int tc_lavc_read_config(TCLavcPri
+ { "vrc_init_cplx", PCTX(rc_initial_cplx), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 9999999.0 },
+ // { "vrc_init_occupancy", }, // not yet supported
+ { "vqsquish", PCTX(rc_qsquish), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 99.0 },
+- { "vlelim", PCTX(luma_elim_threshold), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -99, 99 },
+- { "vcelim", PCTX(chroma_elim_threshold), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -99, 99 },
++ { "vlelim", PAUX(luma_elim_threshold), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -99, 99 },
++ { "vcelim", PAUX(chroma_elim_threshold), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -99, 99 },
+ { "vstrict", PCTX(strict_std_compliance), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -99, 99 },
+ { "vpsize", PCTX(rtp_payload_size), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 100000000 },
+ { "dct", PCTX(dct_algo), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 10 },
+@@ -1182,12 +1215,12 @@ static int tc_lavc_read_config(TCLavcPri
+ { "ibias", PCTX(intra_quant_bias), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -512, 512 },
+ { "pbias", PCTX(inter_quant_bias), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -512, 512 },
+ { "nr", PCTX(noise_reduction), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 1000000},
+- { "qns", PCTX(quantizer_noise_shaping), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 3 },
++ { "qns", PAUX(quantizer_noise_shaping), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 3 },
+ { "inter_matrix_file", inter_matrix_file, TCCONF_TYPE_STRING, 0, 0, 0 },
+ { "intra_matrix_file", intra_matrix_file, TCCONF_TYPE_STRING, 0, 0, 0 },
+
+ { "mv0", PAUX(flags.mv0), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_MV0 },
+- { "cbp", PAUX(flags.cbp), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_CBP_RD },
++ { "cbp", PAUX(flags.cbp), TCCONF_TYPE_FLAG, 0, 0, 1 },
+ { "qpel", PAUX(flags.qpel), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_QPEL },
+ { "alt", PAUX(flags.alt), TCCONF_TYPE_FLAG, 0, 0, 1 },
+ { "ilme", PAUX(flags.ilme), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_INTERLACED_ME },
+@@ -1350,6 +1383,8 @@ static int tc_lavc_configure(TCModuleIns
+
+ pd = self->userdata;
+
++ pd->ff_opts = NULL;
++
+ pd->flush_flag = vob->encoder_flush;
+
+ /* FIXME: move into core? */
+@@ -1402,7 +1437,7 @@ static int tc_lavc_configure(TCModuleIns
+ }
+
+ TC_LOCK_LIBAVCODEC;
+- ret = avcodec_open2(&pd->ff_vcontext, pd->ff_vcodec, pd->ff_opts);
++ ret = avcodec_open2(&pd->ff_vcontext, pd->ff_vcodec, &(pd->ff_opts));
+ TC_UNLOCK_LIBAVCODEC;
+
+ if (ret < 0) {
+Index: transcode-1.1.7/export/export_ffmpeg.c
+===================================================================
+--- transcode-1.1.7.orig/export/export_ffmpeg.c
++++ transcode-1.1.7/export/export_ffmpeg.c
+@@ -122,7 +122,7 @@ static uint8_t *img_buffer =
+ static AVFrame *lavc_convert_frame = NULL;
+
+ static AVCodec *lavc_venc_codec = NULL;
+-static AVDictionary **lavc_venc_opts = NULL;
++static AVDictionary *lavc_venc_opts = NULL;
+ static AVFrame *lavc_venc_frame = NULL;
+ static AVCodecContext *lavc_venc_context;
+ static avi_t *avifile = NULL;
+@@ -486,7 +486,7 @@ MOD_init
+ codec->name, codec->fourCC, codec->comments);
+ }
+
+- lavc_venc_context = avcodec_alloc_context();
++ lavc_venc_context = avcodec_alloc_context3(lavc_venc_codec);
+ lavc_venc_frame = avcodec_alloc_frame();
+
+ lavc_convert_frame= avcodec_alloc_frame();
+@@ -838,8 +838,13 @@ MOD_init
+ lavc_venc_context->rc_strategy = lavc_param_vrc_strategy;
+ lavc_venc_context->b_frame_strategy = lavc_param_vb_strategy;
+ lavc_venc_context->b_quant_offset = lavc_param_vb_qoffset;
+- lavc_venc_context->luma_elim_threshold= lavc_param_luma_elim_threshold;
+- lavc_venc_context->chroma_elim_threshold= lavc_param_chroma_elim_threshold;
++
++ char buf[1024];
++#define set_dict_opt(val, opt) \
++ snprintf(buf, sizeof(buf), "%i", val); \
++ av_dict_set(&lavc_venc_opts, opt, buf, 0)
++ set_dict_opt(lavc_param_luma_elim_threshold, "luma_elim_threshold");
++ set_dict_opt(lavc_param_chroma_elim_threshold, "chroma_elim_threshold");
+ lavc_venc_context->rtp_payload_size = lavc_param_packet_size;
+ #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
+ if (lavc_param_packet_size)
+@@ -870,7 +875,7 @@ MOD_init
+ lavc_venc_context->context_model = lavc_param_context;
+ lavc_venc_context->scenechange_threshold= lavc_param_sc_threshold;
+ lavc_venc_context->noise_reduction = lavc_param_noise_reduction;
+- lavc_venc_context->inter_threshold = lavc_param_inter_threshold;
++ set_dict_opt(lavc_param_inter_threshold, "inter_threshold");
+ lavc_venc_context->intra_dc_precision = lavc_param_intra_dc_precision;
+ lavc_venc_context->skip_top = lavc_param_skip_top;
+ lavc_venc_context->skip_bottom = lavc_param_skip_bottom;
+@@ -1066,9 +1071,11 @@ MOD_init
+ lavc_venc_context->flags |= lavc_param_trunc;
+ lavc_venc_context->flags |= lavc_param_aic;
+ lavc_venc_context->flags |= lavc_param_v4mv;
+- lavc_venc_context->flags |= lavc_param_cbp;
++ if(lavc_param_cbp)
++ av_dict_set(&lavc_venc_opts, "mpv_flags", "+cbp_rd", 0);
+ lavc_venc_context->flags |= lavc_param_mv0;
+- lavc_venc_context->flags |= lavc_param_qp_rd;
++ if(lavc_param_qp_rd)
++ av_dict_set(&lavc_venc_opts, "mpv_flags", "+qp_rd", 0);
+ lavc_venc_context->flags |= lavc_param_ilme;
+ #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
+ lavc_venc_context->flags |= lavc_param_trell;
+@@ -1238,29 +1245,29 @@ MOD_init
+ }
+
+ if (lavc_param_scan_offset) {
+- av_dict_set(lavc_venc_opts, "scan_offset", "1", 0);
++ av_dict_set(&lavc_venc_opts, "scan_offset", "1", 0);
+ }
+
+ if (lavc_param_ss) {
+- av_dict_set(lavc_venc_opts, "structured_slices", "1", 0);
++ av_dict_set(&lavc_venc_opts, "structured_slices", "1", 0);
+ }
+
+ if (lavc_param_alt) {
+- av_dict_set(lavc_venc_opts, "alternate_scan", "1", 0);
++ av_dict_set(&lavc_venc_opts, "alternate_scan", "1", 0);
+ }
+
+ if (lavc_param_umv) {
+- av_dict_set(lavc_venc_opts, "umv", "1", 0);
++ av_dict_set(&lavc_venc_opts, "umv", "1", 0);
+ }
+
+ if (lavc_param_data_partitioning) {
+- av_dict_set(lavc_venc_opts, "vdpart", "1", 0);
++ av_dict_set(&lavc_venc_opts, "vdpart", "1", 0);
+ }
+
+ //-- open codec --
+ //----------------
+ TC_LOCK_LIBAVCODEC;
+- ret = avcodec_open2(lavc_venc_context, lavc_venc_codec, lavc_venc_opts);
++ ret = avcodec_open2(lavc_venc_context, lavc_venc_codec, &lavc_venc_opts);
+ TC_UNLOCK_LIBAVCODEC;
+ if (ret < 0) {
+ tc_log_warn(MOD_NAME, "could not open FFMPEG codec");
+Index: transcode-1.1.7/export/ffmpeg_cfg.c
+===================================================================
+--- transcode-1.1.7.orig/export/ffmpeg_cfg.c
++++ transcode-1.1.7/export/ffmpeg_cfg.c
+@@ -214,10 +214,10 @@ TCConfigEntry lavcopts_conf[]={
+ {"context", &lavc_param_context, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 10},
+ {"intra_matrix", &lavc_param_intra_matrix, TCCONF_TYPE_STRING, 0, 0, 0},
+ {"inter_matrix", &lavc_param_inter_matrix, TCCONF_TYPE_STRING, 0, 0, 0},
+- {"cbp", &lavc_param_cbp, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_CBP_RD},
++ {"cbp", &lavc_param_cbp, TCCONF_TYPE_FLAG, 0, 0, 1},
+ {"mv0", &lavc_param_mv0, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_MV0},
+ {"nr", &lavc_param_noise_reduction, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 1000000},
+- {"qprd", &lavc_param_qp_rd, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_QP_RD},
++ {"qprd", &lavc_param_qp_rd, TCCONF_TYPE_FLAG, 0, 0, 1},
+ {"threads", &lavc_param_threads, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 16},
+ {"ss", &lavc_param_ss, TCCONF_TYPE_FLAG, 0, 0, 1},
+ {"svcd_sof", &lavc_param_scan_offset, TCCONF_TYPE_FLAG, 0, 0, 1},
+Index: transcode-1.1.7/export/aud_aux.c
+===================================================================
+--- transcode-1.1.7.orig/export/aud_aux.c
++++ transcode-1.1.7/export/aud_aux.c
+@@ -346,7 +346,7 @@ static int tc_audio_init_ffmpeg(vob_t *v
+
+ //-- set parameters (bitrate, channels and sample-rate) --
+ //--------------------------------------------------------
+- avcodec_get_context_defaults(&mpa_ctx);
++ avcodec_get_context_defaults3(&mpa_ctx, mpa_codec);
+ #if LIBAVCODEC_VERSION_MAJOR < 53
+ mpa_ctx.codec_type = CODEC_TYPE_AUDIO;
+ #else
+@@ -359,7 +359,7 @@ static int tc_audio_init_ffmpeg(vob_t *v
+ //-- open codec --
+ //----------------
+ TC_LOCK_LIBAVCODEC;
+- ret = avcodec_open(&mpa_ctx, mpa_codec);
++ ret = avcodec_open2(&mpa_ctx, mpa_codec, NULL);
+ TC_UNLOCK_LIBAVCODEC;
+ if (ret < 0) {
+ tc_warn("tc_audio_init_ffmpeg: could not open %s codec !",
+Index: transcode-1.1.7/import/import_ffmpeg.c
+===================================================================
+--- transcode-1.1.7.orig/import/import_ffmpeg.c
++++ transcode-1.1.7/import/import_ffmpeg.c
+@@ -302,7 +302,7 @@ do_avi:
+
+ // Set these to the expected values so that ffmpeg's decoder can
+ // properly detect interlaced input.
+- lavc_dec_context = avcodec_alloc_context();
++ lavc_dec_context = avcodec_alloc_context3(lavc_dec_codec);
+ if (lavc_dec_context == NULL) {
+ tc_log_error(MOD_NAME, "Could not allocate enough memory.");
+ return TC_IMPORT_ERROR;
+@@ -344,7 +344,7 @@ do_avi:
+ }
+
+ TC_LOCK_LIBAVCODEC;
+- ret = avcodec_open(lavc_dec_context, lavc_dec_codec);
++ ret = avcodec_open2(lavc_dec_context, lavc_dec_codec, NULL);
+ TC_UNLOCK_LIBAVCODEC;
+ if (ret < 0) {
+ tc_log_warn(MOD_NAME, "Could not initialize the '%s' codec.",
diff --git a/extra/transcode/transcode-1.1.7-preset-force.patch b/extra/transcode/transcode-1.1.7-preset-force.patch
new file mode 100644
index 000000000..0d1da8b4f
--- /dev/null
+++ b/extra/transcode/transcode-1.1.7-preset-force.patch
@@ -0,0 +1,28 @@
+Do not force using a preset. Do not try to open non-existant preset by default.
+
+Index: transcode-1.1.7/export/export_ffmpeg.c
+===================================================================
+--- transcode-1.1.7.orig/export/export_ffmpeg.c
++++ transcode-1.1.7/export/export_ffmpeg.c
+@@ -1206,7 +1206,7 @@ MOD_init
+ lavc_venc_context->me_method = ME_ZERO + lavc_param_vme;
+
+ /* FIXME: transcode itself contains "broken ffmpeg default settings", thus we need to override them! */
+- if (lavc_param_video_preset) {
++ if (lavc_param_video_preset && strcmp(lavc_param_video_preset, "none")) {
+ avcodec_opts[AVMEDIA_TYPE_VIDEO] = lavc_venc_context;
+ video_codec_name = av_strdup(ffmpeg_codec_name(codec->name));
+
+Index: transcode-1.1.7/export/ffmpeg_cfg.c
+===================================================================
+--- transcode-1.1.7.orig/export/ffmpeg_cfg.c
++++ transcode-1.1.7/export/ffmpeg_cfg.c
+@@ -124,7 +124,7 @@ int lavc_param_gmc = 0;
+ //int lavc_param_atag = 0;
+ //int lavc_param_abitrate = 224;
+
+-char *lavc_param_video_preset = "medium";
++char *lavc_param_video_preset = "none";
+ char *lavc_param_ffmpeg_datadir = "/usr/share/ffmpeg";
+
+ TCConfigEntry lavcopts_conf[]={
diff --git a/extra/transcode/transcode-1.1.7-preset-free.patch b/extra/transcode/transcode-1.1.7-preset-free.patch
new file mode 100644
index 000000000..00494b94b
--- /dev/null
+++ b/extra/transcode/transcode-1.1.7-preset-free.patch
@@ -0,0 +1,34 @@
+Fix invalid free when preset file not found
+https://bugs.gentoo.org/show_bug.cgi?id=322945
+Author: Brennan Shacklett
+
+diff -urN transcode-1.1.7-orig/export/export_ffmpeg.c transcode-1.1.7/export/export_ffmpeg.c
+--- transcode-1.1.7-orig/export/export_ffmpeg.c 2011-11-19 08:50:27.000000000 -0800
++++ transcode-1.1.7/export/export_ffmpeg.c 2012-07-03 20:07:05.669083945 -0700
+@@ -321,7 +321,7 @@
+ }
+
+ if(!f){
+- fprintf(stderr, "File for preset '%s' not found\n", arg);
++ tc_log_error(MOD_NAME, "File for preset '%s' not found", arg);
+ av_exit(1);
+ }
+
+@@ -1207,7 +1207,7 @@
+ /* FIXME: transcode itself contains "broken ffmpeg default settings", thus we need to override them! */
+ if (lavc_param_video_preset) {
+ avcodec_opts[AVMEDIA_TYPE_VIDEO] = lavc_venc_context;
+- video_codec_name = ffmpeg_codec_name(codec->name);
++ video_codec_name = av_strdup(ffmpeg_codec_name(codec->name));
+
+ const char *preset_start = lavc_param_video_preset;
+ while (preset_start) {
+@@ -1225,6 +1225,8 @@
+ if (opt_preset("vpre", preset_name) != 0) {
+ tc_log_warn(MOD_NAME, "Parsing ffmpeg preset '%s' failed", preset_name);
+ }
++ av_free(video_codec_name);
++ video_codec_name = NULL;
+ if (verbose) {
+ int i;
+ tc_log_info(MOD_NAME, "After parsing preset '%s', %i options are overridden:", preset_name, opt_name_count);
diff --git a/extra/transcode/transcode-ffmpeg.patch b/extra/transcode/transcode-ffmpeg.patch
deleted file mode 100644
index 0021d07d5..000000000
--- a/extra/transcode/transcode-ffmpeg.patch
+++ /dev/null
@@ -1,115 +0,0 @@
-diff -Naur transcode-1.1.7-orig/encode/encode_lavc.c transcode-1.1.7/encode/encode_lavc.c
---- transcode-1.1.7-orig/encode/encode_lavc.c 2013-07-13 18:41:25.441796991 -0400
-+++ transcode-1.1.7/encode/encode_lavc.c 2013-07-13 18:45:21.042465999 -0400
-@@ -977,8 +977,6 @@
- pd->ff_vcontext.mpeg_quant = 0;
- pd->ff_vcontext.rc_initial_cplx = 0.0;
- pd->ff_vcontext.rc_qsquish = 1.0;
-- pd->ff_vcontext.luma_elim_threshold = 0;
-- pd->ff_vcontext.chroma_elim_threshold = 0;
- pd->ff_vcontext.strict_std_compliance = 0;
- pd->ff_vcontext.dct_algo = FF_DCT_AUTO;
- pd->ff_vcontext.idct_algo = FF_IDCT_AUTO;
-@@ -1150,8 +1148,6 @@
- { "vrc_init_cplx", PCTX(rc_initial_cplx), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 9999999.0 },
- // { "vrc_init_occupancy", }, // not yet supported
- { "vqsquish", PCTX(rc_qsquish), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 99.0 },
-- { "vlelim", PCTX(luma_elim_threshold), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -99, 99 },
-- { "vcelim", PCTX(chroma_elim_threshold), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -99, 99 },
- { "vstrict", PCTX(strict_std_compliance), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -99, 99 },
- { "vpsize", PCTX(rtp_payload_size), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 100000000 },
- { "dct", PCTX(dct_algo), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 10 },
-@@ -1182,7 +1178,7 @@
- { "intra_matrix_file", intra_matrix_file, TCCONF_TYPE_STRING, 0, 0, 0 },
-
- { "mv0", PAUX(flags.mv0), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_MV0 },
-- { "cbp", PAUX(flags.cbp), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_CBP_RD },
-+ { "cbp", PAUX(flags.cbp), TCCONF_TYPE_FLAG, 0, 0, 0x04000000 },
- { "qpel", PAUX(flags.qpel), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_QPEL },
- { "alt", PAUX(flags.alt), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_ALT_SCAN },
- { "ilme", PAUX(flags.ilme), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_INTERLACED_ME },
-diff -Naur transcode-1.1.7-orig/export/export_ffmpeg.c transcode-1.1.7/export/export_ffmpeg.c
---- transcode-1.1.7-orig/export/export_ffmpeg.c 2013-07-13 18:41:25.438463695 -0400
-+++ transcode-1.1.7/export/export_ffmpeg.c 2013-07-13 18:48:46.263478358 -0400
-@@ -835,8 +835,6 @@
- lavc_venc_context->rc_strategy = lavc_param_vrc_strategy;
- lavc_venc_context->b_frame_strategy = lavc_param_vb_strategy;
- lavc_venc_context->b_quant_offset = lavc_param_vb_qoffset;
-- lavc_venc_context->luma_elim_threshold= lavc_param_luma_elim_threshold;
-- lavc_venc_context->chroma_elim_threshold= lavc_param_chroma_elim_threshold;
- lavc_venc_context->rtp_payload_size = lavc_param_packet_size;
- #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
- if (lavc_param_packet_size)
-@@ -867,7 +865,6 @@
- lavc_venc_context->context_model = lavc_param_context;
- lavc_venc_context->scenechange_threshold= lavc_param_sc_threshold;
- lavc_venc_context->noise_reduction = lavc_param_noise_reduction;
-- lavc_venc_context->inter_threshold = lavc_param_inter_threshold;
- lavc_venc_context->intra_dc_precision = lavc_param_intra_dc_precision;
- lavc_venc_context->skip_top = lavc_param_skip_top;
- lavc_venc_context->skip_bottom = lavc_param_skip_bottom;
-diff -Naur transcode-1.1.7-orig/export/ffmpeg_cfg.c transcode-1.1.7/export/ffmpeg_cfg.c
---- transcode-1.1.7-orig/export/ffmpeg_cfg.c 2013-07-13 18:41:25.438463695 -0400
-+++ transcode-1.1.7/export/ffmpeg_cfg.c 2013-07-13 18:48:34.633609112 -0400
-@@ -50,8 +50,6 @@
- //int lavc_param_vpass = 0;
- int lavc_param_vrc_strategy = 2;
- int lavc_param_vb_strategy = 0;
--int lavc_param_luma_elim_threshold = 0;
--int lavc_param_chroma_elim_threshold = 0;
- int lavc_param_packet_size= 0;
- int lavc_param_strict= 0;
- int lavc_param_data_partitioning= 0;
-@@ -105,7 +103,6 @@
- int lavc_param_mv0= 0;
- int lavc_param_noise_reduction= 0;
- int lavc_param_qp_rd= 0;
--int lavc_param_inter_threshold= 0;
- int lavc_param_sc_threshold= 0;
- int lavc_param_ss= 0;
- int lavc_param_top= -1;
-@@ -156,8 +153,6 @@
- {"vrc_strategy", &lavc_param_vrc_strategy, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 2},
- {"vb_strategy", &lavc_param_vb_strategy, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 10},
- {"vb_qoffset", &lavc_param_vb_qoffset, TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 31.0},
-- {"vlelim", &lavc_param_luma_elim_threshold, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -99, 99},
-- {"vcelim", &lavc_param_chroma_elim_threshold, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -99, 99},
- {"vpsize", &lavc_param_packet_size, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 100000000},
- {"vstrict", &lavc_param_strict, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -99, 99},
- // {"keyint", &lavc_param_keyint, TCCONF_TYPE_INT, 0, 0, 0},
-@@ -215,13 +210,12 @@
- {"context", &lavc_param_context, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 10},
- {"intra_matrix", &lavc_param_intra_matrix, TCCONF_TYPE_STRING, 0, 0, 0},
- {"inter_matrix", &lavc_param_inter_matrix, TCCONF_TYPE_STRING, 0, 0, 0},
-- {"cbp", &lavc_param_cbp, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_CBP_RD},
-+ {"cbp", &lavc_param_cbp, TCCONF_TYPE_FLAG, 0, 0, 0x04000000},
- {"mv0", &lavc_param_mv0, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_MV0},
- {"nr", &lavc_param_noise_reduction, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 1000000},
-- {"qprd", &lavc_param_qp_rd, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_QP_RD},
-+ {"qprd", &lavc_param_qp_rd, TCCONF_TYPE_FLAG, 0, 0, 0x08000000},
- {"threads", &lavc_param_threads, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 16},
- {"ilme", &lavc_param_ilme, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_INTERLACED_ME},
-- {"inter_threshold", &lavc_param_inter_threshold, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -1000000, 1000000},
- {"sc_threshold", &lavc_param_sc_threshold, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -1000000, 1000000},
- {"top", &lavc_param_top, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -1, 1},
- {"gmc", &lavc_param_gmc, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_GMC},
-diff -Naur transcode-1.1.7-orig/export/ffmpeg_cfg.h transcode-1.1.7/export/ffmpeg_cfg.h
---- transcode-1.1.7-orig/export/ffmpeg_cfg.h 2013-07-13 18:41:25.438463695 -0400
-+++ transcode-1.1.7/export/ffmpeg_cfg.h 2013-07-13 18:49:04.169944470 -0400
-@@ -29,8 +29,6 @@
- //extern int lavc_param_vpass;
- extern int lavc_param_vrc_strategy;
- extern int lavc_param_vb_strategy;
--extern int lavc_param_luma_elim_threshold;
--extern int lavc_param_chroma_elim_threshold;
- extern int lavc_param_packet_size;
- extern int lavc_param_strict;
- extern int lavc_param_data_partitioning;
-@@ -84,7 +82,6 @@
- extern int lavc_param_mv0;
- extern int lavc_param_noise_reduction;
- extern int lavc_param_qp_rd;
--extern int lavc_param_inter_threshold;
- extern int lavc_param_sc_threshold;
- extern int lavc_param_ss;
- extern int lavc_param_top;
diff --git a/extra/x2goclient/PKGBUILD b/extra/x2goclient/PKGBUILD
index 2f051b7f5..2312b68a5 100644
--- a/extra/x2goclient/PKGBUILD
+++ b/extra/x2goclient/PKGBUILD
@@ -1,10 +1,10 @@
-# $Id: PKGBUILD 180595 2013-03-24 09:37:30Z andyrtr $
+# $Id: PKGBUILD 194273 2013-09-12 19:24:14Z andyrtr $
# Maintainer: AndyRTR <andyrtr@archlinux.org>
# Contributor: Gerhard Brauer <gerbra@archlinux.de>
# Contributor: Richard Murri <admin@richardmurri.com>
pkgname=x2goclient
-pkgver=4.0.1.0
+pkgver=4.0.1.1
pkgrel=1
pkgdesc="x2go qt4 client"
arch=('i686' 'x86_64')
@@ -14,15 +14,16 @@ depends=('qt4' 'libldap' 'libcups' 'nxproxy' 'libssh' 'libxpm' 'hicolor-icon-the
makedepends=('man2html')
install=x2goclient.install
source=(http://code.x2go.org/releases/source/${pkgname}/${pkgname}-${pkgver}.tar.gz)
-md5sums=('ff223344915b9def9e9e5a01ae919532')
+md5sums=('13b6729acfd5c6a00441430ef6ab69d6')
build() {
- cd "${srcdir}/${pkgname}-${pkgver}"
+ cd ${pkgname}-${pkgver}
sed -i "s:-o root -g root ::" Makefile
+ sed -i "s:lrelease:lrelease-qt4:g" Makefile
make PREFIX=/usr
}
package() {
- cd "${srcdir}/${pkgname}-${pkgver}"
+ cd ${pkgname}-${pkgver}
make PREFIX=/usr DESTDIR="$pkgdir" install
}
diff --git a/libre/hexchat-libre/PKGBUILD b/libre/hexchat-libre/PKGBUILD
index a377c189c..242c4dcb3 100644
--- a/libre/hexchat-libre/PKGBUILD
+++ b/libre/hexchat-libre/PKGBUILD
@@ -1,57 +1,48 @@
-# $Id: PKGBUILD 91125 2013-05-19 21:58:09Z alucryd $
+# $Id: PKGBUILD 97065 2013-09-12 08:20:08Z alucryd $
# Maintainer: Maxime Gauduin <alucryd@gmail.com>
# Contributor: TingPing <tingping@tingping.se>
# Maintainer (Parabola): André Silva <emulatorman@lavabit.com>
_pkgname=hexchat
pkgname=hexchat-libre
-pkgver=2.9.5
-pkgrel=5
+pkgver=2.9.6
+pkgrel=1
pkgdesc="A popular and easy to use graphical IRC (chat) client, without nonfree browser reference (Parabola rebranded)"
arch=('i686' 'x86_64' 'mips64el')
url="http://www.hexchat.org/"
license=('GPL')
-depends=('dbus-glib' 'desktop-file-utils' 'hicolor-icon-theme' 'libnotify' 'libproxy' 'libsexy' 'pciutils')
-makedepends=('perl' 'python2')
+depends=('dbus-glib' 'desktop-file-utils' 'hicolor-icon-theme' 'libcanberra' 'libnotify' 'libproxy' 'libsexy' 'pciutils')
+makedepends=('perl' 'python')
optdepends=('enchant: Spell check'
'perl: Perl plugin'
- 'python2: Python plugin')
+ 'python: Python plugin')
options=('!libtool')
install=${_pkgname}.install
replaces=$_pkgname
conflicts=$_pkgname
provides=$_pkgname=$pkgver
-source=("http://dl.hexchat.org/hexchat/hexchat-${pkgver}.tar.xz"
- 'remove-non-free-suggestion.patch'
- 'no-firefox.patch')
-sha256sums=('11dfd0fbfb88d8dbb38f631fab8a7dffbb179f7f7dafe316953ed6f513ac623d'
- '61040cb2a369b1b8801509c88019d68d1ab4c2505b1dfd859de1a4c22503f02d'
- 'de338821e1a8790a6fbdba2ce41d323002f51e3ae3e99ee8d815fcf087197e45')
+source=("http://dl.hexchat.org/hexchat/hexchat-${pkgver}.tar.xz")
+sha256sums=('eaefc07867a6e546cd9e19a4ccc976b4736c759ba3f946020eeae3cd6f4684b0')
build() {
- cd "${srcdir}"/${_pkgname}-${pkgver}
+ cd ${_pkgname}-${pkgver}
# Rebrand to Parabola
- sed -i -e 's#ArchLinux#Parabola GNU/Linux-libre#' plugins/sysinfo/parse.c
+ sed -i 's#ArchLinux#Parabola GNU/Linux-libre#' plugins/sysinfo/parse.c
# Remove nonfree browser references
- patch -p1 -i "${srcdir}/remove-non-free-suggestion.patch"
- patch -p1 -i "${srcdir}/no-firefox.patch"
+ sed -i '\|NAME Open Link| s|Firefox|Iceweasel|' src/common/hexchat.c
+ sed -i '\|NAME Open Link| s|firefox -private %s\\n\\n";|iceweasel -private %s\\n\\n";\n "NAME Open Link in Private Icecat Window\\n" "CMD !icecat -private %s\\n\\n";|' src/common/hexchat.c
+ sed -i '\|NAME Open Link in Private Iceweasel Window| s|%s\\n\\n";|%s\\n\\n"\\|' src/common/hexchat.c
-# Build
- ./autogen.sh
- ./configure --prefix=/usr --enable-{shm,spell=libsexy,textfe}
+ ./configure --prefix='/usr' --enable-{python='python3',shm,spell='libsexy',textfe,xft}
make
}
package() {
- cd "${srcdir}"/${_pkgname}-${pkgver}
+ cd ${_pkgname}-${pkgver}
-# Install
make DESTDIR="$pkgdir" install
-
-# IRC Mime Types
- desktop-file-edit --add-mime-type='x-scheme-handler/irc;x-scheme-handler/ircs' --set-key=Exec --set-value='sh -c "hexchat --existing --url %u || exec hexchat"' "$pkgdir/usr/share/applications/hexchat.desktop"
}
# vim: ts=2 sw=2 et:
diff --git a/libre/hexchat-libre/no-firefox.patch b/libre/hexchat-libre/no-firefox.patch
deleted file mode 100644
index 998ff4dca..000000000
--- a/libre/hexchat-libre/no-firefox.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-diff -Nur hexchat-2.9.4.orig/src/fe-gtk/fe-gtk.c hexchat-2.9.4/src/fe-gtk/fe-gtk.c
---- hexchat-2.9.4.orig/src/fe-gtk/fe-gtk.c 2012-11-11 07:08:30.000000000 -0200
-+++ hexchat-2.9.4/src/fe-gtk/fe-gtk.c 2013-01-30 23:06:38.670239405 -0200
-@@ -1039,8 +1039,10 @@
- return;
- }
-
-- /* everything failed, what now? just try firefox */
-- if (try_browser ("firefox", NULL, url))
-+ /* everything failed, what now? just try iceweasel or icecat */
-+ if (try_browser ("iceweasel", NULL, url))
-+ return;
-+ if (try_browser ("icecat", NULL, url))
- return;
-
- /* fresh out of ideas... */
diff --git a/libre/hexchat-libre/remove-non-free-suggestion.patch b/libre/hexchat-libre/remove-non-free-suggestion.patch
deleted file mode 100644
index a83a71f17..000000000
--- a/libre/hexchat-libre/remove-non-free-suggestion.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -Nur hexchat-2.9.4.orig/src/common/hexchat.c hexchat-2.9.4/src/common/hexchat.c
---- hexchat-2.9.4.orig/src/common/hexchat.c 2012-11-11 07:08:30.000000000 -0200
-+++ hexchat-2.9.4/src/common/hexchat.c 2013-01-30 23:02:12.884864062 -0200
-@@ -618,7 +618,7 @@
- "NAME WII\n" "CMD quote WHOIS %2 %2\n\n";
-
- static char defaultconf_urlhandlers[] =
-- "NAME Open Link in Opera\n" "CMD !opera -remote 'openURL(%s)'\n\n";
-+ "" "";
-
- #ifdef USE_SIGACTION
- /* Close and open log files on SIGUSR1. Usefull for log rotating */