You are not logged in.

#1 2010-04-11 06:51:26

supulton
Member
Registered: 2008-12-31
Posts: 58

[SOLVED] remove untracked files

I made a PKGBUILD which installs fine. However, the package in question creates some extra files in /usr/share/*package*, which are not tracked by pacman. Is it possible to automatically remove these files should I ever uninstall the package?

Last edited by supulton (2010-04-11 08:53:12)

Offline

#2 2010-04-11 08:25:44

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: [SOLVED] remove untracked files

Your app should not create any files under /usr/share when it's running. /usr/share is for read-only static data - only pacman should add or remove files there during package management operations.

Offline

#3 2010-04-11 08:33:47

supulton
Member
Registered: 2008-12-31
Posts: 58

Re: [SOLVED] remove untracked files

Where should I put it then? The package in question, by the way, is the game Crawl (stone soup). The only non-static files it creates are saves, which can be moved easily, but where is a common location for such things?

Here's the PKGBUILD by the way:

pkgname=stone-soup-tile
pkgver=0.6.0
pkgrel=1
pkgdesc="Community maintained variant of Linley's Dungeon Crawl (tile + ascii)"
arch=('i686' 'x86_64' 'ppc')
url="http://crawl.develz.org/"
depends=('lua' 'libpng' 'libx11' 'ncurses' 'sdl_image')
makedepends=('gcc' 'bison' 'flex')
conflicts=('crawl')
license=('custom')
install=stone-soup.install
source=("http://downloads.sourceforge.net/sourceforge/crawl-ref/stone_soup-$pkgver-nodeps.tar.bz2" 'stone-soup.desktop')
md5sums=('866e315470a592572e7ce8a7214c7615'
         '6c5606ff26b7a8824d6de6c9b253bcdd')

build() {
    cd $srcdir/stone_soup-$pkgver/source
    sed -i 's|bin_prefix    := bin|bin_prefix    := usr/bin|' makefile || return 1
    sed -i 's/INSTALL_UGRP := games:games/INSTALL_UGRP := root:games/' makefile || return 1

    # stone-soup ascii
    sed -i 's/GAME = crawl/GAME = stone-soup/' makefile || return 1
    make DESTDIR=$pkgdir \
        SAVEDIR="/usr/share/stone-soup/save" \
        DATADIR="/usr/share/stone-soup/data" \
        USE_UNICODE=y \
        install || return 1
        
    make clean || return 1
    
    # stone-soup tiles
    sed -i 's/GAME = stone-soup/GAME = stone-soup-tile/' makefile || return 1
    make DESTDIR=$pkgdir \
        SAVEDIR="/usr/share/stone-soup/save" \
        DATADIR="/usr/share/stone-soup/data" \
        TILES=y \
        install || return 1
    
    install -D -m644 $srcdir/stone-soup.desktop "$pkgdir/usr/share/applications/stone-soup.desktop" || return 1
    install -D -m644 ../licence.txt "$pkgdir/usr/share/licenses/stone-soup/license.txt" || return 1
}

And thanks for the help.

Offline

#4 2010-04-11 08:40:25

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: [SOLVED] remove untracked files

I think there are some semi-standards for gaming stuff - but it's not an area I know about. Have a look at some other game PKGBUILDs, see what you can find. You could also have a look at the Arch Gaming repo - details in the wiki.

Offline

#5 2010-04-11 08:43:40

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,427
Website

Re: [SOLVED] remove untracked files

/var/games/$pkgname would seem to be the right place.

Offline

#6 2010-04-11 08:52:16

supulton
Member
Registered: 2008-12-31
Posts: 58

Re: [SOLVED] remove untracked files

tomk wrote:

I think there are some semi-standards for gaming stuff - but it's not an area I know about. Have a look at some other game PKGBUILDs, see what you can find. You could also have a look at the Arch Gaming repo - details in the wiki.

I didn't know about that repo--seems really convenient.

Allan wrote:

/var/games/$pkgname would seem to be the right place.

I saw a few PKGBUILDs using this directory as well. It does look comfy there, and not mucking with any system files. Thanks for the tip.

I'll mark this as SOLVED since I don't mind files in /var/games not being tracked by pacman.

Offline

#7 2010-04-12 03:11:21

Gen2ly
Member
From: Sevierville, TN
Registered: 2009-03-06
Posts: 1,529
Website

Re: [SOLVED] remove untracked files

Yeah some games are designed to only save files in the current directory.  I've seen it before where some had to specify in the install file that the writing to directory needed ownership changed to be able to save game saves.  Probably not recommended but really no alternative neither.


Setting Up a Scripting Environment | Proud donor to wikipedia - link

Offline

#8 2010-04-12 05:55:14

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,356

Re: [SOLVED] remove untracked files

Can't the game just save its saved files to somewhere in the home folder and be done with it?


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#9 2010-04-12 05:56:45

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,427
Website

Re: [SOLVED] remove untracked files

In many cases, upstream gives you no choice but to save these things outside your home directory. e.g. Some games like system-wide highscore files.

Offline

#10 2010-04-12 07:11:18

supulton
Member
Registered: 2008-12-31
Posts: 58

Re: [SOLVED] remove untracked files

Gen2ly wrote:

Yeah some games are designed to only save files in the current directory.  I've seen it before where some had to specify in the install file that the writing to directory needed ownership changed to be able to save game saves.  Probably not recommended but really no alternative neither.

I thought this was what the 'games' group was for, though it doesn't see to be very common in arch.

Offline

Board footer

Powered by FluxBB