You are not logged in.

#1 2014-01-24 23:51:55

darthpenguin
Member
Registered: 2011-09-16
Posts: 77

[SOLVED] Request for system-config-date

Hi All,

I'm running XFCE4 and would really like a GUI tool to adjust time zone, date, time, ntp, etc. The fedora folks have this package http://fedoraproject.org/wiki/SystemConfig/date which seems like it would do the trick. I compiled and installed this software from source but get the following error when I run the application.

  File "/usr/share/system-config-date/system-config-date.py", line 50
    except RuntimeError, e:
                       ^
SyntaxError: invalid syntax

I'm still kind of a newbie so I'm really not sure how to troubleshoot this error and get this working on Arch. I think it would be great if someone could manage to make a PKGBUILD and get this in the AUR. There are other system-config-* packages in the AUR and standard repos (system-config-printer, system-config-samba) so I don't think it should be too hard (but I could be wrong).

Last edited by darthpenguin (2014-01-26 07:32:59)

Offline

#2 2014-01-25 00:43:45

fsckd
Forum Moderator
Registered: 2009-06-15
Posts: 3,514

Re: [SOLVED] Request for system-config-date

It expects /usr/bin/python to be python 2 whereas on Arch it is python 3. You'll need to change every "#!/usr/bin/python" to "#!/usr/bin/python2" and may be more.


aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies

Offline

#3 2014-01-25 01:29:06

darthpenguin
Member
Registered: 2011-09-16
Posts: 77

Re: [SOLVED] Request for system-config-date

Ah yes, I see. What a pain (>.<). I changed the "#!/usr/bin/python" line as you suggested and now I get this error:

Traceback (most recent call last):
  File "/usr/share/system-config-date/system-config-date.py", line 35, in <module>
    from scdate.core.util import _
ImportError: No module named scdate.core.util

I don't even know if it is possible to get this working on Arch. I'll probably keep trying but first... I really should learn python smile

Offline

#4 2014-01-25 05:56:11

Scimmia
Bug Wrangler
Registered: 2012-09-01
Posts: 4,794

Re: [SOLVED] Request for system-config-date

The problem is that you didn't also modify py_rules.mk before building. Try this PKGBUILD:

# Contributor: Doug Newgard <scimmia22 at outlook dot com>

pkgname=system-config-date
pkgver=1.10.7
pkgrel=1
pkgdesc="Lets you set the date and time of your machine, alternatively configure NTP timeservers and specify the system timezone."
arch=('any')
url="http://fedoraproject.org/wiki/SystemConfig/date"
license=('GPL')
depends=('python2' 'polkit' 'gtk-update-icon-cache')
makedepends=('intltool')
install=$pkgname.install
source=("https://fedorahosted.org/released/$pkgname/$pkgname-$pkgver.tar.bz2")
sha256sums=('5110b46fad0857ed42e10ae66ea23bddd622e95eeb90e4f705a1284268e0fdc1')

prepare() {
  cd "$srcdir/$pkgname-$pkgver"
  sed -i 's|python|&2|g' py_rules.mk
  sed -i 's|/usr/bin/python$|&2|' src/system-config-date.py
}

build() {
  cd "$srcdir/$pkgname-$pkgver"
  make
}

package() {
  cd "$srcdir/$pkgname-$pkgver"
  make DESTDIR="$pkgdir" install
  python2 -m compileall -q "$pkgdir/usr/share/system-config-date"
}

And system-config-date.install:

post_install() {
  gtk-update-icon-cache -q -t -f usr/share/icons/hicolor
}

post_upgrade() {
  post_install
}

post_remove() {
  post_install
}

Last edited by Scimmia (2014-01-25 06:11:59)

Online

#5 2014-01-25 17:02:08

darthpenguin
Member
Registered: 2011-09-16
Posts: 77

Re: [SOLVED] Request for system-config-date

Thanks for creating that PKGBUILD. I use it to compile the software and create a package which I then installed with pacman.
Now, when I run system-config-date I get the errors shown below. I installed python-slip thinking that might be the issue but even after installing python-slip (it wasn't already installed) I still get the same error.

Traceback (most recent call last):
  File "/usr/share/system-config-date/system-config-date.py", line 84, in <module>
    useGuiMode(page)
  File "/usr/share/system-config-date/system-config-date.py", line 57, in useGuiMode
    import scdMainWindow
  File "/usr/share/system-config-date/scdMainWindow.py", line 36, in <module>
    from scdate.core import dateBackend
  File "/usr/lib/python2.7/site-packages/scdate/core/dateBackend.py", line 34, in <module>
    from slip.util.files import overwrite_safely
ImportError: No module named slip.util.files

But at least we are able to compile a package so that is progress.

Offline

#6 2014-01-25 17:13:55

Scimmia
Bug Wrangler
Registered: 2012-09-01
Posts: 4,794

Re: [SOLVED] Request for system-config-date

That's because python-slip is a python3 package, this needs python2. I don't see the py2 version packaged, so hold for another PKGBUILD.

Here you go, modified from the one in community

# Contributor: Doug Newgard <scimmia22 at outlook dot com>
# Contributor: Maxime Gauduin <alucryd@gmail.com>

pkgname=python2-slip
pkgver=0.6.0
pkgrel=1
pkgdesc="Simple Library for Python2"
arch=('any')
url="http://fedorahosted.org/python-slip"
license=('GPL2')
depends=('polkit' 'python2-dbus' 'python2-decorator' 'python2-gobject' 'python2-six')
makedepends=('python2-setuptools')
source=("http://fedorahosted.org/released/python-slip/python-slip-${pkgver}.tar.bz2")
sha256sums=('f47361ec52b608309b83c71905e692b6b363eaf3b8a7afdeff866cd94463ad5c')

prepare() {
  sed -i 's|python|&2|g' "$srcdir/python-slip-$pkgver/py_rules.mk"
}

build() {
  cd "$srcdir/python-slip-$pkgver"

  make
}

package() {
  cd "$srcdir/python-slip-$pkgver"

  python2 setup.py install --root="$pkgdir" --optimize='1'
}

Last edited by Scimmia (2014-01-25 17:28:05)

Online

#7 2014-01-26 07:32:16

darthpenguin
Member
Registered: 2011-09-16
Posts: 77

Re: [SOLVED] Request for system-config-date

Hey, this is so cool. It is working. Well kinda. it crashed at least once during testing.

I had to install python2-slip and system-config-date using the PKGBUILDs from Scimmia (thanks Scimmia). I also had to install libsepol and libselinux from the AUR and I had to install something called swig. But I can confirm that (at least so far) it seems to be working.

I find it odd that XFCE does not have a native tool to adjust time/ntp/etc. I know that Gnome, KDE, Mate, and probably Cinnamon have one (unless Cinnamon is using Gnome's tool, they seem to share a lot of the same packages). Maybe someone more talented than I can maintain system-config-date in the AUR? Unless this is not something in high demand (timedatectl isn't too hard to use).

I guess XFCE has always felt incomplete as a DE. Oh well.

Thanks again guys \(^_^)/

Offline

#8 2014-01-26 07:45:21

darthpenguin
Member
Registered: 2011-09-16
Posts: 77

Re: [SOLVED] Request for system-config-date

Additionally, I'll just quickly mention that there is a package called mate-system-tools that has a lot of system management tools including "Time and Date Settings". However, this tool reports that 'NTP support is not installed' even though it is and it doesn't seem to properly read or set the timezone. Still, it might be easier to get this working on XFCE (outside of Mate) instead of maintaining system-config-date. Just a thought anyway.

Offline

Board footer

Powered by FluxBB