Skip to content

Commit

Permalink
Appcenter packaging (#20)
Browse files Browse the repository at this point in the history
* Update debian Control

* Initial Copy of Makefile from disinst [WIP]

* Remove some extra commands

* Compile and install binary

* Install data and icons

* Format Some Code

* Add Vendor Support

* Update debian/rules

* Update Version

* Update version in appdata
  • Loading branch information
arshubham authored Feb 16, 2018
1 parent 569dae7 commit 0557fa0
Show file tree
Hide file tree
Showing 5,956 changed files with 1,706,654 additions and 110 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
7 changes: 7 additions & 0 deletions .cargo/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[source.crates-io]
replace-with = "vendored-sources"

[source.vendored-sources]
directory = "vendor/"


1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ _build/
**/*.rs.bk
srtnr-gtk/target
*~
Makefile
build/
Cargo.lock
*.save
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "srtnr"
version = "0.1.5"
version = "0.1.6"
authors = ["Shubham Arora <[email protected]>"]

[dependencies.gtk]
Expand All @@ -11,7 +11,7 @@ features = ["v3_18"]
gio = "0.3.0"
gdk = "0.7.0"
glib = "0.4.1"
urlshortener = "0.8.0"
urlshortener = "0.8.1"
validator = "0.6.3"
libnotify = "1.0.3"
gdk-pixbuf = "0.3.0"
File renamed without changes.
72 changes: 72 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
prefix ?= /usr
exec_prefix = $(prefix)
bindir = $(exec_prefix)/bin
includedir = $(prefix)/include
datarootdir = $(prefix)/share
datadir = $(datarootdir)

.PHONY: all install uninstall

BIN=com.github.arshubham.srtnr

SRC=src/* src/*/*
DATA=data/*

all: target/release/$(BIN)

debug: target/debug/$(BIN)

clean:
rm -r target/release/data
cargo clean

install: all
install -D -m 0755 "target/release/$(BIN)" "$(DESTDIR)$(bindir)/$(BIN)"
install -D -m 0644 "target/release/data/images/icons/16/com.github.arshubham.srtnr.svg" "$(datarootdir)/icons/hicolor/16x16/apps/com.github.arshubham.srtnr.svg"
install -D -m 0644 "target/release/data/images/icons/24/com.github.arshubham.srtnr.svg" "$(datarootdir)/icons/hicolor/24x24/apps/com.github.arshubham.srtnr.svg"
install -D -m 0644 "target/release/data/images/icons/32/com.github.arshubham.srtnr.svg" "$(datarootdir)/icons/hicolor/32x32/apps/com.github.arshubham.srtnr.svg"
install -D -m 0644 "target/release/data/images/icons/48/com.github.arshubham.srtnr.svg" "$(datarootdir)/icons/hicolor/48x48/apps/com.github.arshubham.srtnr.svg"
install -D -m 0644 "target/release/data/images/icons/64/com.github.arshubham.srtnr.svg" "$(datarootdir)/icons/hicolor/64x64/apps/com.github.arshubham.srtnr.svg"
install -D -m 0644 "target/release/data/images/icons/128/com.github.arshubham.srtnr.svg" "$(datarootdir)/icons/hicolor/128x128/apps/com.github.arshubham.srtnr.svg"
install -D -m 0644 "target/release/data/images/com.github.arshubham.srtnr.svg" "$(datarootdir)/com.github.arshubham.srtnr/images/com.github.arshubham.srtnr.svg"
install -D -m 0644 "target/release/data/images/com.github.arshubham.srtnr.png" "$(datarootdir)/pixmaps/com.github.arshubham.srtnr.png"
install -D -m 0644 "target/release/data/com.github.arshubham.srtnr.appdata.xml" "$(datarootdir)/metainfo/com.github.arshubham.srtnr.appdata.xml"
install -D -m 0644 "target/release/data/com.github.arshubham.srtnr.desktop" "$(datarootdir)/applications/com.github.arshubham.srtnr.desktop"
install -D -m 0644 "target/release/data/com.github.arshubham.srtnr.gschema.xml" "$(datarootdir)/glib-2.0/schemas/com.github.arshubham.srtnr.gschema.xml"
glib-compile-schemas $(datarootdir)/glib-2.0/schemas/

uninstall:
rm -f "$(DESTDIR)$(bindir)/$(BIN)"
rm -f "$(datarootdir)/icons/hicolor/16x16/apps/com.github.arshubham.srtnr.svg"
rm -f "$(datarootdir)/icons/hicolor/24x24/apps/com.github.arshubham.srtnr.svg"
rm -f "$(datarootdir)/icons/hicolor/32x32/apps/com.github.arshubham.srtnr.svg"
rm -f "$(datarootdir)/icons/hicolor/48x48/apps/com.github.arshubham.srtnr.svg"
rm -f "$(datarootdir)/icons/hicolor/64x64/apps/com.github.arshubham.srtnr.svg"
rm -f "$(datarootdir)/icons/hicolor/128x128/apps/com.github.arshubham.srtnr.svg"
rm -rf "$(datarootdir)/com.github.arshubham.srtnr/"
rm -f "$(datarootdir)/pixmaps/com.github.arshubham.srtnr.png"
rm -f "$(datarootdir)/metainfo/com.github.arshubham.srtnr.appdata.xml"
rm -f "$(datarootdir)/applications/com.github.arshubham.srtnr.desktop"
rm -f "$(datarootdir)/glib-2.0/schemas/com.github.arshubham.srtnr.gschema.xml"
glib-compile-schemas $(datarootdir)/glib-2.0/schemas/

.cargo/config: vendor_config
mkdir -p .cargo
cp $< $@

update:
cargo update

vendor: .cargo/config
cargo vendor
touch vendor

target/release/$(BIN): $(SRC)
mkdir -p target/release/data
cp -r $(DATA) target/release/data
if [ -d vendor ]; \
then \
cargo build --release --frozen -p srtnr && mv target/release/srtnr target/release/$(BIN); \
else \
cargo build --release -p srtnr && mv target/release/srtnr target/release/$(BIN); \
fi
2 changes: 1 addition & 1 deletion data/com.github.arshubham.srtnr.appdata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</screenshot>
</screenshots>
<releases>
<release version="0.1.5" date="2018-02-01">
<release version="0.1.6" date="2018-02-16">
<description>
<p>Initial Release</p>
</description>
Expand Down
33 changes: 0 additions & 33 deletions data/meson.build

This file was deleted.

2 changes: 1 addition & 1 deletion debian/changelog
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
com.github.arshubham.srtnr (0.1.5) precise; urgency=low
com.github.arshubham.srtnr (0.1.6) precise; urgency=low

* Initial Release.

Expand Down
28 changes: 16 additions & 12 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,22 @@ Source: com.github.arshubham.srtnr
Section: x11
Priority: extra
Maintainer: Shubham Arora <[email protected]>
Build-Depends: meson,
debhelper (>= 9),
libgtk-3-dev,
libjson-glib-dev,
rustc,
cargo,
libssl-dev,
pkgconf,
libpng-dev
Standards-Version: 3.9.3
Build-Depends:
cargo,
debhelper (>= 9),
rustc,
libjson-glib-dev,
libssl-dev,
pkgconf,
libpng-dev,
libnotify-dev
Standards-Version: 4.1.1

Package: com.github.arshubham.srtnr
Architecture: any
Depends: ${misc:Depends}, ${shlibs:Depends}
Description: Shorten long Urls
Depends:
libgtk-3-dev,
libjson-glib-dev,
${misc:Depends},
${shlibs:Depends}
Description: Shorten long Urls
15 changes: 3 additions & 12 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,8 @@
dh $@

override_dh_auto_clean:
rm -rf debian/build

override_dh_auto_configure:
mkdir -p debian/build
cd debian/build && meson --prefix=/usr ../..

override_dh_auto_build:
cd debian/build && ninja -v

override_dh_auto_test:
cd debian/build && ninja test
make clean
make vendor

override_dh_auto_install:
cd debian/build && DESTDIR=${CURDIR}/debian/com.github.arshubham.srtnr ninja install
dh_auto_install -- prefix=/usr
33 changes: 0 additions & 33 deletions meson.build

This file was deleted.

10 changes: 0 additions & 10 deletions meson/post_install.py

This file was deleted.

5 changes: 0 additions & 5 deletions scripts/cargo.sh

This file was deleted.

1 change: 1 addition & 0 deletions vendor/adler32/.cargo-checksum.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"files":{".travis.yml":"4b265390d238dcd79664069258603bbdfa3ef0012f3289cdfdf2eb656888b9cc","Cargo.toml":"6cba738dddcd24c99d2bd68ea564a8db7b6e1c8e135ad45078fdd45f8fc976fa","LICENSE":"485b7d77429d023aaf97d8dd79f1b2b122f9d529e23b25aee284622f98e2400a","README.md":"3c3150b973b16d5a8d0f6edc6d6d29a039c623c985c269c5d79ef3314f0cc6dd","appveyor.yml":"4873092bae0713890497e5ceae761af359d680e6cce5ce003bf38bc5c45cde44","src/lib.rs":"24e7e7923d2460c98746f91fd77c65793374e7c58ba842f1a3bbd713a2c27996"},"package":"6cbd0b9af8587c72beadc9f72d35b9fbb070982c9e6203e46e93f10df25f8f45"}
18 changes: 18 additions & 0 deletions vendor/adler32/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
language: rust
rust:
- stable
- beta
- nightly
sudo: false
script:
- cargo build --verbose
- cargo test --verbose
- cargo doc
after_success: |
[ $TRAVIS_BRANCH = master ] &&
[ $TRAVIS_RUST_VERSION = nightly ] &&
[ $TRAVIS_PULL_REQUEST = false ] &&
echo '<meta http-equiv=refresh content=0;url=adler32/index.html>' > target/doc/index.html &&
pip install --user ghp-import &&
$HOME/.local/bin/ghp-import -n target/doc &&
git push -qf https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git gh-pages
24 changes: 24 additions & 0 deletions vendor/adler32/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
#
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
# to registry (e.g. crates.io) dependencies
#
# If you believe there's an error in this file please file an
# issue against the rust-lang/cargo repository. If you're
# editing this file be aware that the upstream Cargo.toml
# will likely look very different (and much more reasonable)

[package]
name = "adler32"
version = "1.0.2"
authors = ["Remi Rampin <[email protected]>"]
description = "Minimal Adler32 implementation for Rust."
documentation = "https://remram44.github.io/adler32-rs/index.html"
readme = "README.md"
keywords = ["adler32", "hash", "rolling"]
license = "BSD-3-Clause"
repository = "https://github.com/remram44/adler32-rs"
[dev-dependencies.rand]
version = "0.3"
22 changes: 22 additions & 0 deletions vendor/adler32/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
The MIT License (MIT)

Copyright (c) 2015 Remi Rampin

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

10 changes: 10 additions & 0 deletions vendor/adler32/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[![Build Status](https://travis-ci.org/remram44/adler32-rs.svg?branch=master)](https://travis-ci.org/remram44/adler32-rs/builds)
[![Win Build](https://ci.appveyor.com/api/projects/status/ekyg20rd6rwrus64/branch/master?svg=true)](https://ci.appveyor.com/project/remram44/adler32-rs)
[![Crates.io](https://img.shields.io/crates/v/adler32.svg)](https://crates.io/crates/adler32)

What is this?
=============

It is an implementation of the [Adler32 rolling hash algorithm](https://en.wikipedia.org/wiki/Adler-32) in the [Rust programming language](https://www.rust-lang.org/).

[Generated documentation](https://remram44.github.io/adler32-rs/index.html)
12 changes: 12 additions & 0 deletions vendor/adler32/appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
install:
- ps: Start-FileDownload 'https://static.rust-lang.org/dist/rust-nightly-i686-pc-windows-gnu.exe'
- rust-nightly-i686-pc-windows-gnu.exe /VERYSILENT /NORESTART /DIR="C:\Program Files (x86)\Rust"
- set PATH=%PATH%;C:\Program Files (x86)\Rust\bin
- rustc -V
- cargo -V

build: false

test_script:
- cargo build --verbose
- cargo test --verbose
Loading

0 comments on commit 0557fa0

Please sign in to comment.