diff --git a/.github/workflows/PKGBUILD b/.github/workflows/PKGBUILD new file mode 100644 index 0000000..b586101 --- /dev/null +++ b/.github/workflows/PKGBUILD @@ -0,0 +1,39 @@ +# Maintainer: Alexandr Bogomyakov (ultradesu) + +pkgname=mus-fuse +pkgver=0.7.2 +pkgrel=1 +pkgdesc="Written safely in Rust, FUSE FS with your own private music library hosted on your server securely." +url="https://github.com/house-of-vanity/mus-fuse.git" +arch=(x86_64) +license=(WTFPL) +depends=(openssl fuse) +makedepends=(cargo git fuse openssl) +source=("git+https://github.com/house-of-vanity/$pkgname") +sha512sums=('SKIP') +backup=('etc/mus-fuse.yml') + +pkgver() { + cd "$srcdir/$pkgname" + echo git describe --long --tags | awk -F '-' '{print $1}'| sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' +} + +prepare() { + cd $pkgname-$pkgver + cargo fetch --target x86_64-unknown-linux-gnu +} + +build() { + cd $pkgname-$pkgver + cargo build --release --frozen --all-targets +} + +package() { + cd $pkgname-$pkgver + install -Dt "$pkgdir/usr/bin" target/release/$pkgname + install -Dt "$pkgdir/usr/share/doc/$pkgname" -m644 README.md + install -Dt "$pkgdir/usr/lib/systemd/system" assets/$pkgname.service + mkdir -p "$pkgdir/etc" + cp -n assets/mus-fuse.yml "$pkgdir/etc/mus-fuse.yml" +} + diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b5b04bc..5376b2b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,6 +6,20 @@ on: - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 jobs: + make: + runs-on: ubuntu-latest + container: + image: archlinux + options: --privileged + volumes: + - /sys/fs/cgroup:/sys/fs/cgroup + steps: + - uses: actions/checkout@v2 + - name: Build Arch Linux package + uses: FFY00/build-arch-package@master + with: + PKGBUILD: $GITHUB_WORKSPACE/.github/workflows/PKGBUILD + OUTDIR: $HOME/arch-packages build: name: Upload Release Asset runs-on: ubuntu-latest diff --git a/Cargo.toml b/Cargo.toml index 28fad2a..d817a11 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mus-fuse" -version = "0.7.1" +version = "0.7.2" authors = ["AB "] edition = "2018" license = "WTFPL" @@ -37,10 +37,10 @@ Written safely in Rust, FUSE FS with your own private music library \ hosted on your server securely.""" section = "utilities" priority = "optional" -maintainer-scripts = "assets/" +maintainer-scripts = "debian/" conf-files = ["etc/mus-fuse.yml"] assets = [ ["assets/mus-fuse.service", "/usr/lib/systemd/system/mus-fuse.service", "644"], ["target/release/mus-fuse", "usr/bin/", "755"], - ["assets/conf.yml", "etc/mus-fuse.yml", "644"], + ["assets/mus-fuse.yml", "etc/mus-fuse.yml", "644"], ] diff --git a/README.md b/README.md index 619a5a5..4ae9bed 100644 --- a/README.md +++ b/README.md @@ -16,9 +16,14 @@ MusFuse is a FUSE filesystem over HTTP for music. It is using [playongo](https:/ Here is a [binary release](https://github.com/house-of-vanity/mus_fuse/releases/latest) or compile it yourself. Anyway mind about dependencies listed below. Also there is a systemd unit file for managing service. Place it into `~/.config/systemd/user/mus-fuse.service` ```sh -# Compile +# Compile binary $ cargo build --release +# Making DEB package +$ cargo install cargo-deb +$ cargo deb +# package will be appear in ./target/debian/ + # And run # to baypass Basic Auth set # $HTTP_USER and $HTTP_PASS diff --git a/assets/conf.yml b/assets/conf.yml deleted file mode 100644 index c96e861..0000000 --- a/assets/conf.yml +++ /dev/null @@ -1,12 +0,0 @@ ---- -server: https://mus.test.com -mountpoint: /srv/mus-fuse -http_user: username -http_pass: passwd1337 - -# How many KiB of file beginnings download and store in RAM. -# It's speeding up any metadata operations and media library scanning. -cache_head: 768 - -# How many count of `cache_head` store. -cache_max_count: 10 diff --git a/assets/postinst b/debian/postinst similarity index 100% rename from assets/postinst rename to debian/postinst diff --git a/assets/preinst b/debian/preinst similarity index 100% rename from assets/preinst rename to debian/preinst diff --git a/pkgbuild/PKGBUILD b/pkgbuild/PKGBUILD new file mode 100644 index 0000000..ff55b13 --- /dev/null +++ b/pkgbuild/PKGBUILD @@ -0,0 +1,33 @@ +# Maintainer: Alexandr Bogomyakov (ultradesu) + +pkgname=mus-fuse +pkgver=0.7.2 +pkgrel=1 +pkgdesc="Written safely in Rust, FUSE FS with your own private music library hosted on your server securely." +url="https://github.com/house-of-vanity/mus-fuse.git" +arch=(x86_64) +license=(WTFPL) +depends=(openssl fuse) +makedepends=(cargo git fuse openssl) +source=("$pkgname-$pkgver.tar.gz::https://github.com/house-of-vanity/$pkgname/archive/v$pkgver.tar.gz") +sha512sums=('SKIP') +backup=('etc/mus-fuse.yml') + +prepare() { + cd $pkgname-$pkgver + cargo fetch --target x86_64-unknown-linux-gnu +} + +build() { + cd $pkgname-$pkgver + cargo build --release --frozen --all-targets +} + +package() { + cd $pkgname-$pkgver + install -Dt "$pkgdir/usr/bin" target/release/$pkgname + install -Dt "$pkgdir/usr/share/doc/$pkgname" -m644 README.md + install -Dt "$pkgdir/usr/lib/systemd/system" assets/$pkgname.service + mkdir -p "$pkgdir/etc" + cp -n assets/mus-fuse.yml "$pkgdir/etc/mus-fuse.yml" +}