Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide dotenv-linter in the Arch User Repository #82

Closed
mstruebing opened this issue Feb 12, 2020 · 18 comments · Fixed by #88
Closed

Provide dotenv-linter in the Arch User Repository #82

mstruebing opened this issue Feb 12, 2020 · 18 comments · Fixed by #88
Assignees

Comments

@mstruebing
Copy link
Member

The Arch User Repository is like a package repository for Arch linux maintained by it's users.
I would be happy to set it up there so that any arch user can simply install it with:

<your-aur-helper> -S dotenv-linter (-S is mostly the command to install a package, in case your aur helper does it differently you need to substitute this command.

If that would be desired I would be happy to go :)

@mgrachev
Copy link
Member

@mstruebing 👋Thank you for your good idea!

Before we start I would like to know what we should do to add dotenv-linter to the Arch User Repository?

@mstruebing
Copy link
Member Author

It's maybe easier than you think.
If you are a registered user you can clone an empty repository, in this case ssh://aur@aur.archlinux.org/dotenv-linter-git.git and commit and push a file called PKGBUILD where build and installation information are written. But I would do that for you :)

A sample PKGBUILD file can look like this: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=tldr-go-client-git

@mgrachev mgrachev self-assigned this Feb 13, 2020
@mgrachev
Copy link
Member

@mstruebing Thank you for explanation! I'll do it a bit later.

@mstruebing
Copy link
Member Author

I can do it if you don't mind.

@mgrachev
Copy link
Member

mgrachev commented Feb 13, 2020

Sure, but I’d like to have the ability to update dotenv-linter in the future. How can we do that?

For example, you can prepare the PKGBUILD file and I'll push it to the repository ssh://aur@aur.archlinux.org/dotenv-linter.git.

What do think about it?

@mstruebing
Copy link
Member Author

Maybe it's possible to have something like Co-authors or maintainers.
But otherwise, yeah, I will send it to you and you can publish it :)

@mgrachev
Copy link
Member

@mstruebing Do you plan to use a binary release in PKGBUILD?

@mgrachev mgrachev changed the title Provide dotenv-linter in the Arch User Repository Provide dotenv-linter in the Arch User Repository Feb 14, 2020
@mstruebing
Copy link
Member Author

I would think of building it via cargo, we could have a dotenv-linter-git version, which builds it itself and a dotenv-linter or dotenv-linter-bin version which loads only the binary.

@mgrachev
Copy link
Member

I think if we use a binary file, it'll be easier and faster than building from a source. Do you agree?

@mstruebing
Copy link
Member Author

Yep, the advantage of the additional *-git release would be that you don't need to update the PKGBUILD for every new release and people are able to use the newest version with no additional work.
So I would recommend releasing both versions on the AUR for the best outcome.

For my personal projects, I only release a *-git version because I'm lazy :D

@mstruebing
Copy link
Member Author

I just published the -git version: https://aur.archlinux.org/packages/dotenv-linter-git/

We have two options now.

  • I add you as a co-maintainer
  • I disown the package and then you are able to adopt it (with all already made changes from me)

I'm fine with both solutions, you decide.
I will have a look at the binary package next time I find some spare time :)

$ trizen -S dotenv-linter-git
:: Cloning AUR package: dotenv-linter-git

--------------------------------------------------------------------------------
:: Content of /tmp/trizen-maex/dotenv-linter-git/PKGBUILD
--------------------------------------------------------------------------------

# Maintainer: Max Struebing <mxstrbng@gmail.com>

pkgname=dotenv-linter-git
pkgver=1.1.0.r4.g61ff93d
pkgrel=1
pkgdesc="Linter for .env files. Written in Rust"
arch=(any)
url="https://github.com/mgrachev/dotenv-linter"
license=('MIT')
depends=()
makedepends=('git' 'cargo')
source=("git+$url")
md5sums=('SKIP')
provides=('dotenv-linter')

pkgver() {
    cd "$srcdir/dotenv-linter" || exit
    git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g' | sed 's/^v//g'
}

build() {
    cd "$srcdir/dotenv-linter" || exit
    git clone https://github.com/mgrachev/dotenv-linter.git
    cd dotenv-linter || exit
    cargo build --release

}

package() {
    cd "$srcdir/dotenv-linter/dotenv-linter/target/release" || exit
    install -Dm755 dotenv-linter "$pkgdir/usr/bin/dotenv-linter"
    cd "$srcdir/dotenv-linter/dotenv-linter" || exit
    install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/dotenv-linter/LICENSE"
}

=>> Edit dotenv-linter-git/PKGBUILD? [y/N]:

Repository      : AUR
Name            : dotenv-linter-git
Version         : 1.0.0-1
Maintainer      : mstruebing
URL             : https://github.com/mgrachev/dotenv-linter/releases
AUR URL         : https://aur.archlinux.org/packages.php?ID=696788
License         : MIT
Votes           : 0
Popularity      : 0%
Installed       : No
Out Of Date     : No
Depends On      : None
Make Deps       : git
                  cargo
Check Deps      : None
Optional Deps   : None
Provides        : dotenv-linter
Conflicts With  : None
Replaces        : None
Package Base    : dotenv-linter-git
Last Update     : Fri Feb 14 11:49:14 2020
Description     : Linter for .env files. Written in Rust

==> Making package: dotenv-linter-git 1.1.0.r4.g61ff93d-1 (Fri 14 Feb 2020 11:49:29 AM CET)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Cloning dotenv-linter git repo...
Cloning into bare repository '/tmp/trizen-maex/dotenv-linter-git/dotenv-linter'...
remote: Enumerating objects: 23, done.
remote: Counting objects: 100% (23/23), done.
remote: Compressing objects: 100% (19/19), done.
remote: Total 935 (delta 8), reused 9 (delta 2), pack-reused 912
Receiving objects: 100% (935/935), 277.89 KiB | 1.04 MiB/s, done.
Resolving deltas: 100% (464/464), done.
==> Validating source files with md5sums...
    dotenv-linter ... Skipped
==> Extracting sources...
  -> Creating working copy of dotenv-linter git repo...
Cloning into 'dotenv-linter'...
done.
==> Starting pkgver()...
==> Starting build()...
Cloning into 'dotenv-linter'...
remote: Enumerating objects: 19, done.
remote: Counting objects: 100% (19/19), done.
remote: Compressing objects: 100% (15/15), done.
remote: Total 314 (delta 6), reused 8 (delta 2), pack-reused 295
Receiving objects: 100% (314/314), 176.95 KiB | 819.00 KiB/s, done.
Resolving deltas: 100% (161/161), done.
warning: unused manifest key: package.maintenance
warning: unused manifest key: package.maintenance
    Updating crates.io index
   Compiling libc v0.2.66
   Compiling bitflags v1.2.1
   Compiling unicode-width v0.1.7
   Compiling ansi_term v0.11.0
   Compiling vec_map v0.8.1
   Compiling strsim v0.8.0
   Compiling textwrap v0.11.0
   Compiling atty v0.2.14
   Compiling clap v2.33.0
   Compiling dotenv-linter v1.1.0 (/tmp/trizen-maex/dotenv-linter-git/src/dotenv-linter/dotenv-linter)
    Finished release [optimized] target(s) in 15.62s
==> Entering fakeroot environment...
==> Starting package()...
==> Tidying install...
  -> Removing libtool files...
  -> Purging unwanted files...
  -> Removing static library files...
  -> Stripping unneeded symbols from binaries and libraries...
  -> Compressing man and info pages...
==> Checking for packaging issues...
==> Creating package "dotenv-linter-git"...
  -> Generating .PKGINFO file...
  -> Generating .BUILDINFO file...
  -> Generating .MTREE file...
  -> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: dotenv-linter-git 1.1.0.r4.g61ff93d-1 (Fri 14 Feb 2020 11:49:49 AM CET)
==> Cleaning up...
:: Pacman command: /usr/bin/sudo /usr/bin/pacman /tmp/trizen-maex/dotenv-linter-git/dotenv-linter-git-1.1.0.r4.g61ff93d-1-any.pkg.tar.xz -U
[sudo] password for maex:
loading packages...
resolving dependencies...
looking for conflicting packages...

Packages (1) dotenv-linter-git-1.1.0.r4.g61ff93d-1

Total Installed Size:  0.84 MiB

:: Proceed with installation? [Y/n]
(1/1) checking keys in keyring                                                                                                                 [########################################################################################] 100%
(1/1) checking package integrity                                                                                                               [########################################################################################] 100%
(1/1) loading package files                                                                                                                    [########################################################################################] 100%
(1/1) checking for file conflicts                                                                                                              [########################################################################################] 100%
(1/1) checking available disk space                                                                                                            [########################################################################################] 100%
:: Processing package changes...
(1/1) installing dotenv-linter-git                                                                                                             [########################################################################################] 100%
:: Running post-transaction hooks...
(1/1) Arming ConditionNeedsUpdate...
➜ dotenv-linter-git (master)
$ which dotenv-linter
/usr/bin/dotenv-linter
➜ dotenv-linter-git (master)
$ dotenv-linter --help
dotenv-linter 1.1.0
Mikhail Grachev <work@mgrachev.com>
Linter for .env files

USAGE:
    dotenv-linter [OPTIONS]

FLAGS:
    -h, --help       Prints help information
    -v, --version    Prints version information

OPTIONS:
    -e, --exclude <FILE_NAME>...    Excludes files from check
    -i, --include <FILE_NAME>...    Includes files to check
    -p, --path <DIRECTORY_PATH>     Specify the path of the directory where to run dotenv-linter

@mgrachev
Copy link
Member

@mstruebing You've done a worderful work 🚀Thanks a lot!

I think it will be better if you add me as a co-maintainer. Does AUR allow you to do that?

@mstruebing
Copy link
Member Author

Yes, I only need your username if you've registered on the page (https://aur.archlinux.org/)

@mgrachev
Copy link
Member

Yes, I only need your username if you've registered on the page (https://aur.archlinux.org/)

https://aur.archlinux.org/account/mgrachev

@mstruebing
Copy link
Member Author

I added you and you are also listed on the maintainer field at https://aur.archlinux.org/packages/dotenv-linter-git/

I will probably work at the weekend on the binary release and provide some documentation how to update it once a new release it out.

@mgrachev mgrachev removed their assignment Feb 18, 2020
@mstruebing
Copy link
Member Author

The bin release is out there: https://aur.archlinux.org/packages/dotenv-linter-bin/

I will provide documentation soonish.

➜ dotenv-linter-bin (master)
$ trizen -S dotenv-linter-bin
:: Cloning AUR package: dotenv-linter-bin

--------------------------------------------------------------------------------
:: Content of /tmp/trizen-maex/dotenv-linter-bin/PKGBUILD
--------------------------------------------------------------------------------

# Maintainer: Max Strübing <mxstrbng@gmail.com>
pkgname=dotenv-linter-bin
pkgver=1.1.1
pkgrel=1
pkgdesc="Linter for .env files. Written in Rust"
arch=('x86_64')
url="https://github.com/mgrachev/dotenv-linter"
license=('MIT')
provides=('dotenv-linter')
conflicts=('dotenv-linter-git')

package() {
  # Install binary
  mkdir dotenv-linter-bin
  cd ${srcdir}/${pkgname}
  curl -O -L -C - https://github.com/mgrachev/dotenv-linter/releases/download/v1.1.1/dotenv-linter-linux-x86_64.tar.gz
  tar xzf dotenv-linter-linux-x86_64.tar.gz
  install -Dm 755 "${srcdir}/${pkgname}/dotenv-linter" "${pkgdir}/usr/bin/dotenv-linter"
}

=>> Edit dotenv-linter-bin/PKGBUILD? [y/N]:

Repository      : AUR
Name            : dotenv-linter-bin
Version         : 1.1.1-1
Maintainer      : mstruebing
URL             : https://github.com/mgrachev/dotenv-linter
AUR URL         : https://aur.archlinux.org/packages.php?ID=699160
License         : MIT
Votes           : 0
Popularity      : 0%
Installed       : No
Out Of Date     : No
Depends On      : None
Make Deps       : None
Check Deps      : None
Optional Deps   : None
Provides        : dotenv-linter
Conflicts With  : dotenv-linter-git
Replaces        : None
Package Base    : dotenv-linter-bin
Last Update     : Thu Feb 20 21:12:37 2020
Description     : Linter for .env files. Written in Rust

==> Making package: dotenv-linter-bin 1.1.1-1 (Thu 20 Feb 2020 09:12:59 PM CET)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
==> Extracting sources...
==> Entering fakeroot environment...
==> Starting package()...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   624  100   624    0     0    235      0  0:00:02  0:00:02 --:--:--   234
100  963k  100  963k    0     0  43826      0  0:00:22  0:00:22 --:--:-- 96927
==> Tidying install...
  -> Removing libtool files...
  -> Purging unwanted files...
  -> Removing static library files...
  -> Stripping unneeded symbols from binaries and libraries...
  -> Compressing man and info pages...
==> Checking for packaging issues...
==> Creating package "dotenv-linter-bin"...
  -> Generating .PKGINFO file...
  -> Generating .BUILDINFO file...
  -> Generating .MTREE file...
  -> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: dotenv-linter-bin 1.1.1-1 (Thu 20 Feb 2020 09:13:23 PM CET)
==> Cleaning up...
:: Pacman command: /usr/bin/sudo /usr/bin/pacman /tmp/trizen-maex/dotenv-linter-bin/dotenv-linter-bin-1.1.1-1-x86_64.pkg.tar.xz -U
[sudo] password for maex:
loading packages...
resolving dependencies...
looking for conflicting packages...

Packages (1) dotenv-linter-bin-1.1.1-1

Total Installed Size:  0.80 MiB

:: Proceed with installation? [Y/n]
(1/1) checking keys in keyring                                         [########################################] 100%
(1/1) checking package integrity                                       [########################################] 100%
(1/1) loading package files                                            [########################################] 100%
(1/1) checking for file conflicts                                      [########################################] 100%
(1/1) checking available disk space                                    [########################################] 100%
:: Processing package changes...
(1/1) installing dotenv-linter-bin                                     [########################################] 100%
:: Running post-transaction hooks...
(1/1) Arming ConditionNeedsUpdate...
➜ dotenv-linter-bin (master)
$ which dotenv-linter
/usr/bin/dotenv-linter
➜ dotenv-linter-bin (master)
$ dotenv-linter --help
dotenv-linter 1.1.1
Mikhail Grachev <work@mgrachev.com>
Linter for .env files

USAGE:
    dotenv-linter [OPTIONS]

FLAGS:
    -h, --help       Prints help information
    -v, --version    Prints version information

OPTIONS:
    -e, --exclude <FILE_NAME>...    Excludes files from check
    -i, --include <FILE_NAME>...    Includes files to check
    -p, --path <DIRECTORY_PATH>     Specify the path of the directory where to run dotenv-linter

@mstruebing
Copy link
Member Author

Where should I put the documentation? Would CONTRIBUTING.md a good place?
Or would we rather have something like RELEASE.md where we gather different release instructions?

@mgrachev
Copy link
Member

mgrachev commented Feb 21, 2020

@mstruebing I think the best place to store release build information will be RELEASE.md.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants