mirror of
https://github.com/Jguer/yay
synced 2024-10-31 13:42:27 +00:00
Refactoring
This commit is contained in:
parent
4e67864662
commit
5ad1772bba
34 changed files with 2689 additions and 129 deletions
27
Gopkg.lock
generated
Normal file
27
Gopkg.lock
generated
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
|
||||||
|
|
||||||
|
|
||||||
|
[[projects]]
|
||||||
|
branch = "master"
|
||||||
|
name = "github.com/jguer/go-alpm"
|
||||||
|
packages = ["."]
|
||||||
|
revision = "f82ad11b38f675991ef2425dbeff03ef346bc113"
|
||||||
|
|
||||||
|
[[projects]]
|
||||||
|
branch = "master"
|
||||||
|
name = "github.com/mikkeloscar/aur"
|
||||||
|
packages = ["."]
|
||||||
|
revision = "dc2f99767ec5d809269bd3bac3878f6e949f8e64"
|
||||||
|
|
||||||
|
[[projects]]
|
||||||
|
branch = "master"
|
||||||
|
name = "github.com/mikkeloscar/gopkgbuild"
|
||||||
|
packages = ["."]
|
||||||
|
revision = "46d010163d87513b0f05fb67400475348bd50cc9"
|
||||||
|
|
||||||
|
[solve-meta]
|
||||||
|
analyzer-name = "dep"
|
||||||
|
analyzer-version = 1
|
||||||
|
inputs-digest = "456465ee334310996a51a2282bf4cfe9f6269db508479c962474d61a4ce0a08c"
|
||||||
|
solver-name = "gps-cdcl"
|
||||||
|
solver-version = 1
|
34
Gopkg.toml
Normal file
34
Gopkg.toml
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
|
||||||
|
# Gopkg.toml example
|
||||||
|
#
|
||||||
|
# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md
|
||||||
|
# for detailed Gopkg.toml documentation.
|
||||||
|
#
|
||||||
|
# required = ["github.com/user/thing/cmd/thing"]
|
||||||
|
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
|
||||||
|
#
|
||||||
|
# [[constraint]]
|
||||||
|
# name = "github.com/user/project"
|
||||||
|
# version = "1.0.0"
|
||||||
|
#
|
||||||
|
# [[constraint]]
|
||||||
|
# name = "github.com/user/project2"
|
||||||
|
# branch = "dev"
|
||||||
|
# source = "github.com/myfork/project2"
|
||||||
|
#
|
||||||
|
# [[override]]
|
||||||
|
# name = "github.com/x/y"
|
||||||
|
# version = "2.4.0"
|
||||||
|
|
||||||
|
|
||||||
|
[[constraint]]
|
||||||
|
branch = "master"
|
||||||
|
name = "github.com/jguer/go-alpm"
|
||||||
|
|
||||||
|
[[constraint]]
|
||||||
|
branch = "master"
|
||||||
|
name = "github.com/mikkeloscar/aur"
|
||||||
|
|
||||||
|
[[constraint]]
|
||||||
|
branch = "master"
|
||||||
|
name = "github.com/mikkeloscar/gopkgbuild"
|
81
actions.go
81
actions.go
|
@ -1,17 +1,12 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bufio"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"sort"
|
|
||||||
"strconv"
|
|
||||||
"strings"
|
|
||||||
|
|
||||||
aur "github.com/jguer/yay/aur"
|
aur "github.com/jguer/yay/aur"
|
||||||
"github.com/jguer/yay/config"
|
"github.com/jguer/yay/config"
|
||||||
pac "github.com/jguer/yay/pacman"
|
pac "github.com/jguer/yay/pacman"
|
||||||
"github.com/jguer/yay/upgrade"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Install handles package installs
|
// Install handles package installs
|
||||||
|
@ -34,82 +29,6 @@ func install(pkgs []string, flags []string) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Upgrade handles updating the cache and installing updates.
|
|
||||||
func upgradePkgs(flags []string) error {
|
|
||||||
aurUp, repoUp, err := upgrade.List()
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
} else if len(aurUp)+len(repoUp) == 0 {
|
|
||||||
fmt.Println("\nthere is nothing to do")
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
sort.Sort(repoUp)
|
|
||||||
fmt.Printf("\x1b[1;34;1m:: \x1b[0m\x1b[1m%d Packages to upgrade.\x1b[0m\n", len(aurUp)+len(repoUp))
|
|
||||||
upgrade.Print(len(aurUp), repoUp)
|
|
||||||
upgrade.Print(0, aurUp)
|
|
||||||
fmt.Print("\x1b[32mEnter packages you don't want to upgrade.\x1b[0m\nNumbers: ")
|
|
||||||
reader := bufio.NewReader(os.Stdin)
|
|
||||||
|
|
||||||
numberBuf, overflow, err := reader.ReadLine()
|
|
||||||
if err != nil || overflow {
|
|
||||||
fmt.Println(err)
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
result := strings.Fields(string(numberBuf))
|
|
||||||
var repoNums []int
|
|
||||||
var aurNums []int
|
|
||||||
for _, numS := range result {
|
|
||||||
num, err := strconv.Atoi(numS)
|
|
||||||
if err != nil {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
if num > len(aurUp)+len(repoUp)-1 || num < 0 {
|
|
||||||
continue
|
|
||||||
} else if num < len(aurUp) {
|
|
||||||
num = len(aurUp) - num - 1
|
|
||||||
aurNums = append(aurNums, num)
|
|
||||||
} else {
|
|
||||||
num = len(aurUp) + len(repoUp) - num - 1
|
|
||||||
repoNums = append(repoNums, num)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if len(repoUp) != 0 {
|
|
||||||
var repoNames []string
|
|
||||||
repoloop:
|
|
||||||
for i, k := range repoUp {
|
|
||||||
for _, j := range repoNums {
|
|
||||||
if j == i {
|
|
||||||
continue repoloop
|
|
||||||
}
|
|
||||||
}
|
|
||||||
repoNames = append(repoNames, k.Name)
|
|
||||||
}
|
|
||||||
|
|
||||||
err := config.PassToPacman("-S", repoNames, flags)
|
|
||||||
if err != nil {
|
|
||||||
fmt.Println("Error upgrading repo packages.")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if len(aurUp) != 0 {
|
|
||||||
var aurNames []string
|
|
||||||
aurloop:
|
|
||||||
for i, k := range aurUp {
|
|
||||||
for _, j := range aurNums {
|
|
||||||
if j == i {
|
|
||||||
continue aurloop
|
|
||||||
}
|
|
||||||
}
|
|
||||||
aurNames = append(aurNames, k.Name)
|
|
||||||
}
|
|
||||||
aur.Install(aurNames, flags)
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// CleanDependencies removels all dangling dependencies in system
|
// CleanDependencies removels all dangling dependencies in system
|
||||||
func cleanDependencies(pkgs []string) error {
|
func cleanDependencies(pkgs []string) error {
|
||||||
hanging, err := pac.HangingPackages()
|
hanging, err := pac.HangingPackages()
|
||||||
|
|
|
@ -1,18 +1,23 @@
|
||||||
// Package upgrade package is responsible for returning lists of outdated packages.
|
package main
|
||||||
package upgrade
|
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bufio"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"os"
|
||||||
|
"sort"
|
||||||
|
"strconv"
|
||||||
|
"strings"
|
||||||
"unicode"
|
"unicode"
|
||||||
|
|
||||||
alpm "github.com/jguer/go-alpm"
|
alpm "github.com/jguer/go-alpm"
|
||||||
|
"github.com/jguer/yay/aur"
|
||||||
"github.com/jguer/yay/config"
|
"github.com/jguer/yay/config"
|
||||||
rpc "github.com/mikkeloscar/aur"
|
rpc "github.com/mikkeloscar/aur"
|
||||||
pkgb "github.com/mikkeloscar/gopkgbuild"
|
pkgb "github.com/mikkeloscar/gopkgbuild"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Upgrade type describes a system upgrade.
|
// upgrade type describes a system upgrade.
|
||||||
type Upgrade struct {
|
type upgrade struct {
|
||||||
Name string
|
Name string
|
||||||
Repository string
|
Repository string
|
||||||
LocalVersion string
|
LocalVersion string
|
||||||
|
@ -20,14 +25,14 @@ type Upgrade struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Slice is a slice of Upgrades
|
// Slice is a slice of Upgrades
|
||||||
type Slice []Upgrade
|
type upSlice []upgrade
|
||||||
|
|
||||||
func (s Slice) Len() int { return len(s) }
|
func (u upSlice) Len() int { return len(u) }
|
||||||
func (s Slice) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
|
func (u upSlice) Swap(i, j int) { u[i], u[j] = u[j], u[i] }
|
||||||
|
|
||||||
func (s Slice) Less(i, j int) bool {
|
func (u upSlice) Less(i, j int) bool {
|
||||||
iRunes := []rune(s[i].Repository)
|
iRunes := []rune(u[i].Repository)
|
||||||
jRunes := []rune(s[j].Repository)
|
jRunes := []rune(u[j].Repository)
|
||||||
|
|
||||||
max := len(iRunes)
|
max := len(iRunes)
|
||||||
if max > len(jRunes) {
|
if max > len(jRunes) {
|
||||||
|
@ -94,7 +99,7 @@ func FilterPackages() (local []alpm.Package, remote []alpm.Package,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Print prints the details of the packages to upgrade.
|
// Print prints the details of the packages to upgrade.
|
||||||
func Print(start int, u Slice) {
|
func (u upSlice) Print(start int) {
|
||||||
for k, i := range u {
|
for k, i := range u {
|
||||||
old, err := pkgb.NewCompleteVersion(i.LocalVersion)
|
old, err := pkgb.NewCompleteVersion(i.LocalVersion)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -129,27 +134,26 @@ func Print(start int, u Slice) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// List returns lists of packages to upgrade from each source.
|
// List returns lists of packages to upgrade from each source.
|
||||||
func List() (aurUp Slice, repoUp Slice, err error) {
|
func upList() (aurUp upSlice, repoUp upSlice, err error) {
|
||||||
|
|
||||||
local, remote, _, remoteNames, err := FilterPackages()
|
local, remote, _, remoteNames, err := FilterPackages()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
repoC := make(chan []Upgrade)
|
repoC := make(chan upSlice)
|
||||||
aurC := make(chan []Upgrade)
|
aurC := make(chan upSlice)
|
||||||
errC := make(chan error)
|
errC := make(chan error)
|
||||||
|
|
||||||
fmt.Println("\x1b[1;36;1m::\x1b[0m\x1b[1m Searching databases for updates...\x1b[0m")
|
fmt.Println("\x1b[1;36;1m::\x1b[0m\x1b[1m Searching databases for updates...\x1b[0m")
|
||||||
go func() {
|
go func() {
|
||||||
repoUpList, err := repo(local)
|
repoUpList, err := upRepo(local)
|
||||||
errC <- err
|
errC <- err
|
||||||
repoC <- repoUpList
|
repoC <- repoUpList
|
||||||
}()
|
}()
|
||||||
|
|
||||||
fmt.Println("\x1b[1;36;1m::\x1b[0m\x1b[1m Searching AUR for updates...\x1b[0m")
|
fmt.Println("\x1b[1;36;1m::\x1b[0m\x1b[1m Searching AUR for updates...\x1b[0m")
|
||||||
go func() {
|
go func() {
|
||||||
aurUpList, err := aur(remote, remoteNames)
|
aurUpList, err := upAUR(remote, remoteNames)
|
||||||
errC <- err
|
errC <- err
|
||||||
aurC <- aurUpList
|
aurC <- aurUpList
|
||||||
}()
|
}()
|
||||||
|
@ -180,12 +184,12 @@ loop:
|
||||||
|
|
||||||
// aur gathers foreign packages and checks if they have new versions.
|
// aur gathers foreign packages and checks if they have new versions.
|
||||||
// Output: Upgrade type package list.
|
// Output: Upgrade type package list.
|
||||||
func aur(remote []alpm.Package, remoteNames []string) (toUpgrade Slice, err error) {
|
func upAUR(remote []alpm.Package, remoteNames []string) (toUpgrade upSlice, err error) {
|
||||||
var j int
|
var j int
|
||||||
var routines int
|
var routines int
|
||||||
var routineDone int
|
var routineDone int
|
||||||
|
|
||||||
packageC := make(chan Upgrade)
|
packageC := make(chan upgrade)
|
||||||
done := make(chan bool)
|
done := make(chan bool)
|
||||||
|
|
||||||
for i := len(remote); i != 0; i = j {
|
for i := len(remote); i != 0; i = j {
|
||||||
|
@ -216,7 +220,7 @@ func aur(remote []alpm.Package, remoteNames []string) (toUpgrade Slice, err erro
|
||||||
} else if qtemp[x].Name == local[i].Name() {
|
} else if qtemp[x].Name == local[i].Name() {
|
||||||
if (config.YayConf.TimeUpdate && (int64(qtemp[x].LastModified) > local[i].BuildDate().Unix())) ||
|
if (config.YayConf.TimeUpdate && (int64(qtemp[x].LastModified) > local[i].BuildDate().Unix())) ||
|
||||||
(alpm.VerCmp(local[i].Version(), qtemp[x].Version) < 0) {
|
(alpm.VerCmp(local[i].Version(), qtemp[x].Version) < 0) {
|
||||||
packageC <- Upgrade{qtemp[x].Name, "aur", local[i].Version(), qtemp[x].Version}
|
packageC <- upgrade{qtemp[x].Name, "aur", local[i].Version(), qtemp[x].Version}
|
||||||
}
|
}
|
||||||
continue
|
continue
|
||||||
} else {
|
} else {
|
||||||
|
@ -243,13 +247,13 @@ func aur(remote []alpm.Package, remoteNames []string) (toUpgrade Slice, err erro
|
||||||
|
|
||||||
// repo gathers local packages and checks if they have new versions.
|
// repo gathers local packages and checks if they have new versions.
|
||||||
// Output: Upgrade type package list.
|
// Output: Upgrade type package list.
|
||||||
func repo(local []alpm.Package) (Slice, error) {
|
func upRepo(local []alpm.Package) (upSlice, error) {
|
||||||
dbList, err := config.AlpmHandle.SyncDbs()
|
dbList, err := config.AlpmHandle.SyncDbs()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
slice := Slice{}
|
slice := upSlice{}
|
||||||
primeloop:
|
primeloop:
|
||||||
for _, pkg := range local {
|
for _, pkg := range local {
|
||||||
newPkg := pkg.NewVersion(dbList)
|
newPkg := pkg.NewVersion(dbList)
|
||||||
|
@ -272,8 +276,84 @@ primeloop:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
slice = append(slice, Upgrade{pkg.Name(), newPkg.DB().Name(), pkg.Version(), newPkg.Version()})
|
slice = append(slice, upgrade{pkg.Name(), newPkg.DB().Name(), pkg.Version(), newPkg.Version()})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return slice, nil
|
return slice, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Upgrade handles updating the cache and installing updates.
|
||||||
|
func upgradePkgs(flags []string) error {
|
||||||
|
aurUp, repoUp, err := upList()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
} else if len(aurUp)+len(repoUp) == 0 {
|
||||||
|
fmt.Println("\nthere is nothing to do")
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
sort.Sort(repoUp)
|
||||||
|
fmt.Printf("\x1b[1;34;1m:: \x1b[0m\x1b[1m%d Packages to upgrade.\x1b[0m\n", len(aurUp)+len(repoUp))
|
||||||
|
repoUp.Print(len(aurUp))
|
||||||
|
aurUp.Print(0)
|
||||||
|
fmt.Print("\x1b[32mEnter packages you don't want to upgrade.\x1b[0m\nNumbers: ")
|
||||||
|
reader := bufio.NewReader(os.Stdin)
|
||||||
|
|
||||||
|
numberBuf, overflow, err := reader.ReadLine()
|
||||||
|
if err != nil || overflow {
|
||||||
|
fmt.Println(err)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
result := strings.Fields(string(numberBuf))
|
||||||
|
var repoNums []int
|
||||||
|
var aurNums []int
|
||||||
|
for _, numS := range result {
|
||||||
|
num, err := strconv.Atoi(numS)
|
||||||
|
if err != nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if num > len(aurUp)+len(repoUp)-1 || num < 0 {
|
||||||
|
continue
|
||||||
|
} else if num < len(aurUp) {
|
||||||
|
num = len(aurUp) - num - 1
|
||||||
|
aurNums = append(aurNums, num)
|
||||||
|
} else {
|
||||||
|
num = len(aurUp) + len(repoUp) - num - 1
|
||||||
|
repoNums = append(repoNums, num)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(repoUp) != 0 {
|
||||||
|
var repoNames []string
|
||||||
|
repoloop:
|
||||||
|
for i, k := range repoUp {
|
||||||
|
for _, j := range repoNums {
|
||||||
|
if j == i {
|
||||||
|
continue repoloop
|
||||||
|
}
|
||||||
|
}
|
||||||
|
repoNames = append(repoNames, k.Name)
|
||||||
|
}
|
||||||
|
|
||||||
|
err := config.PassToPacman("-S", repoNames, flags)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println("Error upgrading repo packages.")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(aurUp) != 0 {
|
||||||
|
var aurNames []string
|
||||||
|
aurloop:
|
||||||
|
for i, k := range aurUp {
|
||||||
|
for _, j := range aurNums {
|
||||||
|
if j == i {
|
||||||
|
continue aurloop
|
||||||
|
}
|
||||||
|
}
|
||||||
|
aurNames = append(aurNames, k.Name)
|
||||||
|
}
|
||||||
|
aur.Install(aurNames, flags)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
1
vendor/github.com/jguer/go-alpm/.gitignore
generated
vendored
Normal file
1
vendor/github.com/jguer/go-alpm/.gitignore
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
_obj/
|
82
vendor/github.com/jguer/go-alpm/alpm_test.go
generated
vendored
Normal file
82
vendor/github.com/jguer/go-alpm/alpm_test.go
generated
vendored
Normal file
|
@ -0,0 +1,82 @@
|
||||||
|
// alpm_test.go - Tests for alpm.go.
|
||||||
|
//
|
||||||
|
// Copyright (c) 2013 The go-alpm Authors
|
||||||
|
//
|
||||||
|
// MIT Licensed. See LICENSE for details.
|
||||||
|
|
||||||
|
package alpm
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
"testing"
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
root = "/"
|
||||||
|
dbpath = "/var/lib/pacman"
|
||||||
|
)
|
||||||
|
|
||||||
|
var h *Handle
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
var err error
|
||||||
|
h, err = Init("/", "/var/lib/pacman")
|
||||||
|
if err != nil {
|
||||||
|
fmt.Printf("failed to Init(): %s", err)
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func ExampleVersion() {
|
||||||
|
fmt.Println(Version())
|
||||||
|
// output:
|
||||||
|
// 8.0.2
|
||||||
|
}
|
||||||
|
|
||||||
|
func ExampleVerCmp() {
|
||||||
|
fmt.Println(VerCmp("1.0-2", "2.0-1") < 0)
|
||||||
|
fmt.Println(VerCmp("1:1.0-2", "2.0-1") > 0)
|
||||||
|
fmt.Println(VerCmp("2.0.2-2", "2.0.2-2") == 0)
|
||||||
|
// output:
|
||||||
|
// true
|
||||||
|
// true
|
||||||
|
// true
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestRevdeps(t *testing.T) {
|
||||||
|
db, _ := h.LocalDb()
|
||||||
|
pkg, _ := db.PkgByName("glibc")
|
||||||
|
for i, pkgname := range pkg.ComputeRequiredBy() {
|
||||||
|
t.Logf(pkgname)
|
||||||
|
if i == 10 {
|
||||||
|
t.Logf("and %d more...", len(pkg.ComputeRequiredBy())-10)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestLocalDB(t *testing.T) {
|
||||||
|
defer func() {
|
||||||
|
if recover() != nil {
|
||||||
|
t.Errorf("local db failed")
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
db, _ := h.LocalDb()
|
||||||
|
number := 0
|
||||||
|
for _, pkg := range db.PkgCache().Slice() {
|
||||||
|
number++
|
||||||
|
if number <= 15 {
|
||||||
|
t.Logf("%v", pkg.Name())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if number > 15 {
|
||||||
|
t.Logf("%d more packages...", number-15)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestRelease(t *testing.T) {
|
||||||
|
if err := h.Release(); err != nil {
|
||||||
|
t.Error(err)
|
||||||
|
}
|
||||||
|
}
|
66
vendor/github.com/jguer/go-alpm/conf_test.go
generated
vendored
Normal file
66
vendor/github.com/jguer/go-alpm/conf_test.go
generated
vendored
Normal file
|
@ -0,0 +1,66 @@
|
||||||
|
// conf_test.go - Tests for conf.go.
|
||||||
|
//
|
||||||
|
// Copyright (c) 2013 The go-alpm Authors
|
||||||
|
//
|
||||||
|
// MIT Licensed. See LICENSE for details.
|
||||||
|
|
||||||
|
package alpm
|
||||||
|
|
||||||
|
import (
|
||||||
|
"os"
|
||||||
|
"reflect"
|
||||||
|
"testing"
|
||||||
|
)
|
||||||
|
|
||||||
|
var pacmanConfRef = PacmanConfig{
|
||||||
|
RootDir: "/",
|
||||||
|
DBPath: "/var/lib/pacman",
|
||||||
|
CacheDir: []string{"/var/cache/pacman/pkg", "/other/cachedir"},
|
||||||
|
LogFile: "/var/log/pacman.log",
|
||||||
|
GPGDir: "/etc/pacman.d/gnupg/",
|
||||||
|
HoldPkg: []string{"pacman", "glibc"},
|
||||||
|
XferCommand: "/usr/bin/wget --passive-ftp -c -O %o %u",
|
||||||
|
Architecture: "auto",
|
||||||
|
CleanMethod: "KeepInstalled",
|
||||||
|
UseDelta: "0.7",
|
||||||
|
IgnorePkg: []string{"hello", "world"},
|
||||||
|
IgnoreGroup: []string{"kde"},
|
||||||
|
NoUpgrade: nil,
|
||||||
|
NoExtract: nil,
|
||||||
|
|
||||||
|
Options: ConfColor | ConfCheckSpace | ConfVerbosePkgLists,
|
||||||
|
|
||||||
|
Repos: []RepoConfig{
|
||||||
|
{Name: "core", Servers: []string{"ftp://ftp.example.com/foobar/$repo/os/$arch/"}},
|
||||||
|
{Name: "custom", Servers: []string{"file:///home/custompkgs"}},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
func detailedDeepEqual(t *testing.T, x, y interface{}) {
|
||||||
|
v := reflect.ValueOf(x)
|
||||||
|
w := reflect.ValueOf(y)
|
||||||
|
if v.Type() != w.Type() {
|
||||||
|
t.Errorf("differing types %T vs. %T", x, y)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
for i := 0; i < v.NumField(); i++ {
|
||||||
|
v_fld := v.Field(i).Interface()
|
||||||
|
w_fld := w.Field(i).Interface()
|
||||||
|
if !reflect.DeepEqual(v_fld, w_fld) {
|
||||||
|
t.Errorf("field %s differs: got %#v, expected %#v",
|
||||||
|
v.Type().Field(i).Name, v_fld, w_fld)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestParseConfigGood(t *testing.T) {
|
||||||
|
f, err := os.Open("testing/conf/good_pacman.conf")
|
||||||
|
if err != nil {
|
||||||
|
t.Error(err)
|
||||||
|
}
|
||||||
|
conf, err := ParseConfig(f)
|
||||||
|
if err != nil {
|
||||||
|
t.Error(err)
|
||||||
|
}
|
||||||
|
detailedDeepEqual(t, conf, pacmanConfRef)
|
||||||
|
}
|
13
vendor/github.com/jguer/go-alpm/examples/Makefile
generated
vendored
Normal file
13
vendor/github.com/jguer/go-alpm/examples/Makefile
generated
vendored
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
all: alpm-installed alpm-search alpm-updates
|
||||||
|
|
||||||
|
alpm-installed: installed.go
|
||||||
|
go build -x -o $@ $<
|
||||||
|
|
||||||
|
alpm-search: search.go
|
||||||
|
go build -x -o $@ $<
|
||||||
|
|
||||||
|
alpm-updates: updates.go
|
||||||
|
go build -x -o $@ $<
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f alpm-installed alpm-search alpm-updates
|
1
vendor/github.com/jguer/go-alpm/examples/README.md
generated
vendored
Normal file
1
vendor/github.com/jguer/go-alpm/examples/README.md
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
To build the examples, use make. The alpm library must be in your GOPATH.
|
38
vendor/github.com/jguer/go-alpm/examples/installed.go
generated
vendored
Normal file
38
vendor/github.com/jguer/go-alpm/examples/installed.go
generated
vendored
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
// installed.go - Example of getting a list of installed packages.
|
||||||
|
//
|
||||||
|
// Copyright (c) 2013 The go-alpm Authors
|
||||||
|
//
|
||||||
|
// MIT Licensed. See LICENSE for details.
|
||||||
|
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/demizer/go-alpm"
|
||||||
|
"os"
|
||||||
|
"fmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
|
||||||
|
h, er := alpm.Init("/", "/var/lib/pacman")
|
||||||
|
if er != nil {
|
||||||
|
print(er, "\n")
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
|
||||||
|
db, er := h.LocalDb()
|
||||||
|
if er != nil {
|
||||||
|
fmt.Println(er)
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, pkg := range db.PkgCache().Slice() {
|
||||||
|
fmt.Printf("%s %s\n", pkg.Name(), pkg.Version())
|
||||||
|
}
|
||||||
|
|
||||||
|
if h.Release() != nil {
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
|
||||||
|
os.Exit(0)
|
||||||
|
}
|
30
vendor/github.com/jguer/go-alpm/examples/search.go
generated
vendored
Normal file
30
vendor/github.com/jguer/go-alpm/examples/search.go
generated
vendored
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// Copyright (c) 2013 The go-alpm Authors
|
||||||
|
//
|
||||||
|
// MIT Licensed. See LICENSE for details.
|
||||||
|
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/demizer/go-alpm"
|
||||||
|
"fmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
h, er := alpm.Init("/", "/var/lib/pacman")
|
||||||
|
if er != nil {
|
||||||
|
fmt.Println(er)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
defer h.Release()
|
||||||
|
|
||||||
|
db, _ := h.RegisterSyncDb("core", 0)
|
||||||
|
h.RegisterSyncDb("community", 0)
|
||||||
|
h.RegisterSyncDb("extra", 0)
|
||||||
|
|
||||||
|
for _, pkg := range db.PkgCache().Slice() {
|
||||||
|
fmt.Printf("%s %s\n %s\n",
|
||||||
|
pkg.Name(), pkg.Version(), pkg.Description())
|
||||||
|
}
|
||||||
|
}
|
78
vendor/github.com/jguer/go-alpm/examples/updates.go
generated
vendored
Normal file
78
vendor/github.com/jguer/go-alpm/examples/updates.go
generated
vendored
Normal file
|
@ -0,0 +1,78 @@
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// Copyright (c) 2013 The go-alpm Authors
|
||||||
|
//
|
||||||
|
// MIT Licensed. See LICENSE for details.
|
||||||
|
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"github.com/demizer/go-alpm"
|
||||||
|
"log"
|
||||||
|
"os"
|
||||||
|
)
|
||||||
|
|
||||||
|
func human(size int64) string {
|
||||||
|
floatsize := float32(size)
|
||||||
|
units := [...]string{"", "Ki", "Mi", "Gi", "Ti", "Pi", "Ei", "Zi", "Yi"}
|
||||||
|
for _, unit := range units {
|
||||||
|
if floatsize < 1024 {
|
||||||
|
return fmt.Sprintf("%.1f %sB", floatsize, unit)
|
||||||
|
}
|
||||||
|
floatsize /= 1024
|
||||||
|
}
|
||||||
|
return fmt.Sprintf("%d%s", size, "B")
|
||||||
|
}
|
||||||
|
|
||||||
|
func upgrades(h *alpm.Handle) ([]alpm.Package, error) {
|
||||||
|
localDb, err := h.LocalDb()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
syncDbs, err := h.SyncDbs()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
slice := []alpm.Package{}
|
||||||
|
for _, pkg := range localDb.PkgCache().Slice() {
|
||||||
|
newPkg := pkg.NewVersion(syncDbs)
|
||||||
|
if newPkg != nil {
|
||||||
|
slice = append(slice, *newPkg)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return slice, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
|
||||||
|
file, err := os.Open("/etc/pacman.conf")
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalln(err)
|
||||||
|
}
|
||||||
|
conf, err := alpm.ParseConfig(file)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalln(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
h, err := conf.CreateHandle()
|
||||||
|
defer h.Release()
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalln(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
upgrades, err := upgrades(h)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalln(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
var size int64 = 0
|
||||||
|
for _, pkg := range upgrades {
|
||||||
|
size += pkg.Size()
|
||||||
|
fmt.Printf("%s %s -> %s\n", pkg.Name(), pkg.Version(),
|
||||||
|
pkg.Version())
|
||||||
|
}
|
||||||
|
fmt.Printf("Total Download Size: %s\n", human(size))
|
||||||
|
}
|
89
vendor/github.com/jguer/go-alpm/package_test.go
generated
vendored
Normal file
89
vendor/github.com/jguer/go-alpm/package_test.go
generated
vendored
Normal file
|
@ -0,0 +1,89 @@
|
||||||
|
// package_test.go - Tests for package.go
|
||||||
|
//
|
||||||
|
// Copyright (c) 2013 The go-alpm Authors
|
||||||
|
//
|
||||||
|
// MIT Licensed. See LICENSE for details.
|
||||||
|
|
||||||
|
package alpm
|
||||||
|
|
||||||
|
import (
|
||||||
|
"bytes"
|
||||||
|
"fmt"
|
||||||
|
"testing"
|
||||||
|
"text/template"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Auxiliary formatting
|
||||||
|
const pkginfo_template = `
|
||||||
|
Name : {{ .Name }}
|
||||||
|
Version : {{ .Version }}
|
||||||
|
Architecture : {{ .Architecture }}
|
||||||
|
Description : {{ .Description }}
|
||||||
|
URL : {{ .URL }}
|
||||||
|
Groups : {{ .Groups.Slice }}
|
||||||
|
Licenses : {{ .Licenses.Slice }}
|
||||||
|
Dependencies : {{ range .Depends.Slice }}{{ . }} {{ end }}
|
||||||
|
Provides : {{ range .Provides.Slice }}{{ . }} {{ end }}
|
||||||
|
Replaces : {{ range .Replaces.Slice }}{{ . }} {{ end }}
|
||||||
|
Conflicts : {{ range .Conflicts.Slice }}{{ . }} {{ end }}
|
||||||
|
Packager : {{ .Packager }}
|
||||||
|
Build Date : {{ .PrettyBuildDate }}
|
||||||
|
Install Date : {{ .PrettyInstallDate }}
|
||||||
|
Package Size : {{ .Size }} bytes
|
||||||
|
Install Size : {{ .ISize }} bytes
|
||||||
|
MD5 Sum : {{ .MD5Sum }}
|
||||||
|
SHA256 Sum : {{ .SHA256Sum }}
|
||||||
|
Reason : {{ .Reason }}
|
||||||
|
|
||||||
|
Required By : {{ .ComputeRequiredBy }}
|
||||||
|
Files : {{ range .Files }}
|
||||||
|
{{ .Name }} {{ .Size }}{{ end }}
|
||||||
|
`
|
||||||
|
|
||||||
|
var pkginfo_tpl *template.Template
|
||||||
|
|
||||||
|
type PrettyPackage struct {
|
||||||
|
Package
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p PrettyPackage) PrettyBuildDate() string {
|
||||||
|
return p.BuildDate().Format(time.RFC1123)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p PrettyPackage) PrettyInstallDate() string {
|
||||||
|
return p.InstallDate().Format(time.RFC1123)
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
var er error
|
||||||
|
pkginfo_tpl, er = template.New("info").Parse(pkginfo_template)
|
||||||
|
if er != nil {
|
||||||
|
fmt.Printf("couldn't compile template: %s\n", er)
|
||||||
|
panic("template parsing error")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Tests package attribute getters.
|
||||||
|
func TestPkginfo(t *testing.T) {
|
||||||
|
h, er := Init(root, dbpath)
|
||||||
|
defer h.Release()
|
||||||
|
if er != nil {
|
||||||
|
t.Errorf("Failed at alpm initialization: %s", er)
|
||||||
|
}
|
||||||
|
|
||||||
|
t.Log("Printing package information for pacman")
|
||||||
|
db, _ := h.LocalDb()
|
||||||
|
|
||||||
|
pkg, _ := db.PkgByName("pacman")
|
||||||
|
buf := bytes.NewBuffer(nil)
|
||||||
|
pkginfo_tpl.Execute(buf, PrettyPackage{*pkg})
|
||||||
|
t.Logf("%s...", buf.Bytes()[:1024])
|
||||||
|
|
||||||
|
pkg, _ = db.PkgByName("linux")
|
||||||
|
if pkg != nil {
|
||||||
|
buf = bytes.NewBuffer(nil)
|
||||||
|
pkginfo_tpl.Execute(buf, PrettyPackage{*pkg})
|
||||||
|
t.Logf("%s...", buf.Bytes()[:1024])
|
||||||
|
}
|
||||||
|
}
|
1
vendor/github.com/jguer/go-alpm/testing/README.md
generated
vendored
Normal file
1
vendor/github.com/jguer/go-alpm/testing/README.md
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
This directory contains testing related files.
|
41
vendor/github.com/jguer/go-alpm/testing/conf/good_pacman.conf
generated
vendored
Normal file
41
vendor/github.com/jguer/go-alpm/testing/conf/good_pacman.conf
generated
vendored
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
#
|
||||||
|
# GENERAL OPTIONS
|
||||||
|
#
|
||||||
|
[options]
|
||||||
|
RootDir = /
|
||||||
|
DBPath = /var/lib/pacman
|
||||||
|
CacheDir = /var/cache/pacman/pkg /other/cachedir
|
||||||
|
LogFile = /var/log/pacman.log
|
||||||
|
GPGDir = /etc/pacman.d/gnupg/
|
||||||
|
HoldPkg = pacman glibc
|
||||||
|
#XferCommand = /usr/bin/curl -C - -f %u > %o
|
||||||
|
XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
|
||||||
|
CleanMethod = KeepInstalled
|
||||||
|
UseDelta = 0.7
|
||||||
|
Architecture = auto
|
||||||
|
|
||||||
|
# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
|
||||||
|
IgnorePkg = hello world
|
||||||
|
IgnoreGroup = kde
|
||||||
|
|
||||||
|
#NoUpgrade =
|
||||||
|
#NoExtract =
|
||||||
|
|
||||||
|
# Misc options
|
||||||
|
#UseSyslog
|
||||||
|
Color
|
||||||
|
#TotalDownload
|
||||||
|
CheckSpace
|
||||||
|
VerbosePkgLists
|
||||||
|
|
||||||
|
# By default, pacman accepts packages signed by keys that its local keyring
|
||||||
|
# trusts (see pacman-key and its man page), as well as unsigned packages.
|
||||||
|
SigLevel = Required DatabaseOptional
|
||||||
|
LocalFileSigLevel = Optional
|
||||||
|
#RemoteFileSigLevel = Required
|
||||||
|
|
||||||
|
[core]
|
||||||
|
Server = ftp://ftp.example.com/foobar/$repo/os/$arch/
|
||||||
|
|
||||||
|
[custom]
|
||||||
|
Server = file:///home/custompkgs
|
69
vendor/github.com/mikkeloscar/aur/aur_test.go
generated
vendored
Normal file
69
vendor/github.com/mikkeloscar/aur/aur_test.go
generated
vendored
Normal file
|
@ -0,0 +1,69 @@
|
||||||
|
package aur
|
||||||
|
|
||||||
|
import "testing"
|
||||||
|
|
||||||
|
// TestSearch test searching for packages by name and/or description
|
||||||
|
func TestSearch(t *testing.T) {
|
||||||
|
rs, err := Search("linux")
|
||||||
|
if err != nil {
|
||||||
|
t.Error(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(rs) < 100 {
|
||||||
|
t.Errorf("Expected more than 100 packages, got '%d'", len(rs))
|
||||||
|
}
|
||||||
|
|
||||||
|
rs, err = Search("li")
|
||||||
|
if err.Error() != "Too many package results." {
|
||||||
|
t.Errorf("Expected error 'Too many package results.', got '%s'", err.Error())
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(rs) > 0 {
|
||||||
|
t.Errorf("Expected no results, got '%d'", len(rs))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// TestSearchByNameDesc test searching for packages package name and desc.
|
||||||
|
func TestSearchByNameDesc(t *testing.T) {
|
||||||
|
rs, err := SearchByNameDesc("linux")
|
||||||
|
if err != nil {
|
||||||
|
t.Error(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(rs) < 100 {
|
||||||
|
t.Errorf("Expected more than 100 packages, got '%d'", len(rs))
|
||||||
|
}
|
||||||
|
|
||||||
|
rs, err = Search("li")
|
||||||
|
if err.Error() != "Too many package results." {
|
||||||
|
t.Errorf("Expected error 'Too many package results.', got '%s'", err.Error())
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(rs) > 0 {
|
||||||
|
t.Errorf("Expected no results, got '%d'", len(rs))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// TestSearchByMaintainer test searching for packages by maintainer
|
||||||
|
func TestSearchByMaintainer(t *testing.T) {
|
||||||
|
rs, err := SearchByMaintainer("moscar")
|
||||||
|
if err != nil {
|
||||||
|
t.Error(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(rs) < 3 {
|
||||||
|
t.Errorf("Expected more than 3 packages, got '%d'", len(rs))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// TestInfo test getting info for multiple packages
|
||||||
|
func TestInfo(t *testing.T) {
|
||||||
|
rs, err := Info([]string{"neovim-git", "linux-mainline"})
|
||||||
|
if err != nil {
|
||||||
|
t.Error(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(rs) != 2 {
|
||||||
|
t.Errorf("Expected two packages, got %d", len(rs))
|
||||||
|
}
|
||||||
|
}
|
211
vendor/github.com/mikkeloscar/gopkgbuild/pkgbuild_test.go
generated
vendored
Normal file
211
vendor/github.com/mikkeloscar/gopkgbuild/pkgbuild_test.go
generated
vendored
Normal file
|
@ -0,0 +1,211 @@
|
||||||
|
package pkgbuild
|
||||||
|
|
||||||
|
import "testing"
|
||||||
|
|
||||||
|
// Test version parsing
|
||||||
|
func TestVersionParsing(t *testing.T) {
|
||||||
|
versions := map[string]bool{
|
||||||
|
"1.0beta": true,
|
||||||
|
"1.0.0.0.2": true,
|
||||||
|
"a.3_4": true,
|
||||||
|
"A.2": true,
|
||||||
|
"_1.2": false,
|
||||||
|
".2": false,
|
||||||
|
"a.2Ø": false,
|
||||||
|
"1.?": false,
|
||||||
|
"1.-": false,
|
||||||
|
}
|
||||||
|
|
||||||
|
for version, valid := range versions {
|
||||||
|
_, err := parseVersion(version)
|
||||||
|
if err != nil && valid {
|
||||||
|
t.Errorf("Version string '%s' should parse", version)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err == nil && !valid {
|
||||||
|
t.Errorf("Version string '%s' should not parse", version)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Test complete-version parsing
|
||||||
|
func TestCompleteVersionParsing(t *testing.T) {
|
||||||
|
versions := map[string]*CompleteVersion{
|
||||||
|
"1:1.0beta": &CompleteVersion{Version("1.0beta"), 1, 0},
|
||||||
|
"1.0": &CompleteVersion{Version("1.0"), 0, 0},
|
||||||
|
"2.3-2": &CompleteVersion{Version("2.3"), 0, 2},
|
||||||
|
"1::": nil,
|
||||||
|
"4.3--1": nil,
|
||||||
|
"4.1-a": nil,
|
||||||
|
"f:2.3": nil,
|
||||||
|
"1.?": nil,
|
||||||
|
}
|
||||||
|
|
||||||
|
for version, expected := range versions {
|
||||||
|
ver, err := NewCompleteVersion(version)
|
||||||
|
if err != nil && expected != nil {
|
||||||
|
t.Errorf("CompleteVersion string '%s' should not parse", version)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err == nil && expected != nil {
|
||||||
|
if ver.Version != expected.Version || ver.Epoch != expected.Epoch || ver.Pkgrel != expected.Pkgrel {
|
||||||
|
t.Errorf("CompleteVersion string '%s' should parse", version)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Test Newer method
|
||||||
|
func TestNewer(t *testing.T) {
|
||||||
|
a := &PKGBUILD{
|
||||||
|
Epoch: 0,
|
||||||
|
Pkgver: Version("1.0"),
|
||||||
|
Pkgrel: 1,
|
||||||
|
}
|
||||||
|
b := &PKGBUILD{
|
||||||
|
Epoch: 0,
|
||||||
|
Pkgver: Version("2.0"),
|
||||||
|
Pkgrel: 1,
|
||||||
|
}
|
||||||
|
c := &PKGBUILD{
|
||||||
|
Epoch: 1,
|
||||||
|
Pkgver: Version("1.0"),
|
||||||
|
Pkgrel: 1,
|
||||||
|
}
|
||||||
|
d := &PKGBUILD{
|
||||||
|
Epoch: 0,
|
||||||
|
Pkgver: Version("1.0"),
|
||||||
|
Pkgrel: 2,
|
||||||
|
}
|
||||||
|
|
||||||
|
if a.Newer(b) {
|
||||||
|
t.Errorf("a (%s) should not be newer than b (%s)", a.Version(), b.Version())
|
||||||
|
}
|
||||||
|
|
||||||
|
if b.Newer(c) {
|
||||||
|
t.Errorf("b (%s) should not be newer than c (%s)", b.Version(), c.Version())
|
||||||
|
}
|
||||||
|
|
||||||
|
if a.Newer(d) {
|
||||||
|
t.Errorf("a (%s) should not be newer than d (%s)", a.Version(), d.Version())
|
||||||
|
}
|
||||||
|
|
||||||
|
if a.Newer(a) {
|
||||||
|
t.Errorf("a (%s) should not be newer than itself", a.Version())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Test Older method
|
||||||
|
func TestOlder(t *testing.T) {
|
||||||
|
a := &PKGBUILD{
|
||||||
|
Epoch: 0,
|
||||||
|
Pkgver: Version("1.0"),
|
||||||
|
Pkgrel: 1,
|
||||||
|
}
|
||||||
|
b := &PKGBUILD{
|
||||||
|
Epoch: 0,
|
||||||
|
Pkgver: Version("2.0"),
|
||||||
|
Pkgrel: 1,
|
||||||
|
}
|
||||||
|
c := &PKGBUILD{
|
||||||
|
Epoch: 1,
|
||||||
|
Pkgver: Version("1.0"),
|
||||||
|
Pkgrel: 1,
|
||||||
|
}
|
||||||
|
d := &PKGBUILD{
|
||||||
|
Epoch: 0,
|
||||||
|
Pkgver: Version("1.0"),
|
||||||
|
Pkgrel: 2,
|
||||||
|
}
|
||||||
|
|
||||||
|
if !a.Older(b) {
|
||||||
|
t.Errorf("a (%s) should be older than b (%s)", a.Version(), b.Version())
|
||||||
|
}
|
||||||
|
|
||||||
|
if !b.Older(c) {
|
||||||
|
t.Errorf("b (%s) should be older than c (%s)", b.Version(), c.Version())
|
||||||
|
}
|
||||||
|
|
||||||
|
if !a.Older(d) {
|
||||||
|
t.Errorf("a (%s) should be older than d (%s)", a.Version(), d.Version())
|
||||||
|
}
|
||||||
|
|
||||||
|
if d.Older(d) {
|
||||||
|
t.Errorf("d (%s) should not be older than itself", d.Version())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Test Version method
|
||||||
|
func TestVersionMethod(t *testing.T) {
|
||||||
|
a := &PKGBUILD{
|
||||||
|
Epoch: 0,
|
||||||
|
Pkgver: Version("1.0"),
|
||||||
|
Pkgrel: 1,
|
||||||
|
}
|
||||||
|
|
||||||
|
version := "1.0-1"
|
||||||
|
|
||||||
|
if a.Version() != version {
|
||||||
|
t.Errorf("a (%s) should be %s", a.Version(), version)
|
||||||
|
}
|
||||||
|
|
||||||
|
b := &PKGBUILD{
|
||||||
|
Epoch: 4,
|
||||||
|
Pkgver: Version("1.0"),
|
||||||
|
Pkgrel: 1,
|
||||||
|
}
|
||||||
|
|
||||||
|
version = "4:1.0-1"
|
||||||
|
|
||||||
|
if b.Version() != version {
|
||||||
|
t.Errorf("a (%s) should be %s", b.Version(), version)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Test random SRCINFO files based on pkgbuilds from Arch core
|
||||||
|
func TestRandomCoreSRCINFOs(t *testing.T) {
|
||||||
|
srcinfos := []string{
|
||||||
|
"sudo",
|
||||||
|
"pacman",
|
||||||
|
"openssh",
|
||||||
|
"grub",
|
||||||
|
"glibc",
|
||||||
|
"systemd",
|
||||||
|
"linux",
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, srcinfo := range srcinfos {
|
||||||
|
path := "./test_pkgbuilds/SRCINFO_" + srcinfo
|
||||||
|
pkg, err := ParseSRCINFO(path)
|
||||||
|
if err != nil {
|
||||||
|
t.Errorf("PKGBUILD for %s did not parse: %s", srcinfo, err.Error())
|
||||||
|
}
|
||||||
|
|
||||||
|
if pkg.Pkgbase != srcinfo {
|
||||||
|
t.Errorf("pkgbase for %s should be %s", srcinfo, pkg.Pkgbase)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestParseDependency(t *testing.T) {
|
||||||
|
deps := make([]*Dependency, 0)
|
||||||
|
_, err := parseDependency("linux-mainline-headers<4.6rc1", deps)
|
||||||
|
if err != nil {
|
||||||
|
t.Errorf("could not parse dependency %s: %s", "bla", err.Error())
|
||||||
|
}
|
||||||
|
|
||||||
|
_, err = parseDependency("linux-mainline-headers<=4.6rc1", deps)
|
||||||
|
if err != nil {
|
||||||
|
t.Errorf("could not parse dependency %s: %s", "bla", err.Error())
|
||||||
|
}
|
||||||
|
|
||||||
|
_, err = parseDependency("linux-mainline-headers>=4.6rc1", deps)
|
||||||
|
if err != nil {
|
||||||
|
t.Errorf("could not parse dependency %s: %s", "bla", err.Error())
|
||||||
|
}
|
||||||
|
|
||||||
|
_, err = parseDependency("linux-mainline-headers==4.6rc1", deps)
|
||||||
|
if err != nil {
|
||||||
|
t.Errorf("could not parse dependency %s: %s", "bla", err.Error())
|
||||||
|
}
|
||||||
|
}
|
150
vendor/github.com/mikkeloscar/gopkgbuild/test_pkgbuilds/PKGBUILD_glibc
generated
vendored
Normal file
150
vendor/github.com/mikkeloscar/gopkgbuild/test_pkgbuilds/PKGBUILD_glibc
generated
vendored
Normal file
|
@ -0,0 +1,150 @@
|
||||||
|
# $Id: PKGBUILD 227086 2014-11-25 12:39:13Z allan $
|
||||||
|
# Maintainer: Allan McRae <allan@archlinux.org>
|
||||||
|
|
||||||
|
# toolchain build order: linux-api-headers->glibc->binutils->gcc->binutils->glibc
|
||||||
|
# NOTE: valgrind requires rebuilt with each major glibc version
|
||||||
|
|
||||||
|
# NOTE: adjust version in install script when locale files are updated
|
||||||
|
|
||||||
|
pkgname=glibc
|
||||||
|
pkgver=2.20
|
||||||
|
pkgrel=4
|
||||||
|
pkgdesc="GNU C Library"
|
||||||
|
arch=('i686' 'x86_64')
|
||||||
|
url="http://www.gnu.org/software/libc"
|
||||||
|
license=('GPL' 'LGPL')
|
||||||
|
groups=('base')
|
||||||
|
depends=('linux-api-headers>=3.16' 'tzdata' 'filesystem>=2013.01')
|
||||||
|
makedepends=('gcc>=4.9')
|
||||||
|
backup=(etc/gai.conf
|
||||||
|
etc/locale.gen
|
||||||
|
etc/nscd.conf)
|
||||||
|
options=('!strip' 'staticlibs')
|
||||||
|
install=glibc.install
|
||||||
|
source=(http://ftp.gnu.org/gnu/libc/${pkgname}-${pkgver}.tar.xz{,.sig}
|
||||||
|
glibc-2.20-roundup.patch
|
||||||
|
locale.gen.txt
|
||||||
|
locale-gen)
|
||||||
|
md5sums=('948a6e06419a01bd51e97206861595b0'
|
||||||
|
'SKIP'
|
||||||
|
'8cfa2a0fa2a9aad8b86a138587d6261f'
|
||||||
|
'07ac979b6ab5eeb778d55f041529d623'
|
||||||
|
'476e9113489f93b348b21e144b6a8fcf')
|
||||||
|
|
||||||
|
validpgpkeys=('F37CDAB708E65EA183FD1AF625EF0A436C2A4AFF') # Carlos O'Donell
|
||||||
|
|
||||||
|
prepare() {
|
||||||
|
cd ${srcdir}/glibc-${pkgver}
|
||||||
|
|
||||||
|
# glibc-2.20..d73ac1bb
|
||||||
|
patch -p1 -i $srcdir/glibc-2.20-roundup.patch
|
||||||
|
|
||||||
|
mkdir ${srcdir}/glibc-build
|
||||||
|
}
|
||||||
|
|
||||||
|
build() {
|
||||||
|
cd ${srcdir}/glibc-build
|
||||||
|
|
||||||
|
if [[ ${CARCH} = "i686" ]]; then
|
||||||
|
# Hack to fix NPTL issues with Xen, only required on 32bit platforms
|
||||||
|
# TODO: make separate glibc-xen package for i686
|
||||||
|
export CFLAGS="${CFLAGS} -mno-tls-direct-seg-refs"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "slibdir=/usr/lib" >> configparms
|
||||||
|
echo "rtlddir=/usr/lib" >> configparms
|
||||||
|
echo "sbindir=/usr/bin" >> configparms
|
||||||
|
echo "rootsbindir=/usr/bin" >> configparms
|
||||||
|
|
||||||
|
# remove hardening options for building libraries
|
||||||
|
CFLAGS=${CFLAGS/-fstack-protector-strong/}
|
||||||
|
CPPFLAGS=${CPPFLAGS/-D_FORTIFY_SOURCE=2/}
|
||||||
|
|
||||||
|
${srcdir}/${pkgname}-${pkgver}/configure --prefix=/usr \
|
||||||
|
--libdir=/usr/lib --libexecdir=/usr/lib \
|
||||||
|
--with-headers=/usr/include \
|
||||||
|
--with-bugurl=https://bugs.archlinux.org/ \
|
||||||
|
--enable-add-ons \
|
||||||
|
--enable-obsolete-rpc \
|
||||||
|
--enable-kernel=2.6.32 \
|
||||||
|
--enable-bind-now --disable-profile \
|
||||||
|
--enable-stackguard-randomization \
|
||||||
|
--enable-lock-elision \
|
||||||
|
--enable-multi-arch
|
||||||
|
|
||||||
|
# build libraries with hardening disabled
|
||||||
|
echo "build-programs=no" >> configparms
|
||||||
|
make
|
||||||
|
|
||||||
|
# re-enable hardening for programs
|
||||||
|
sed -i "/build-programs=/s#no#yes#" configparms
|
||||||
|
echo "CC += -fstack-protector-strong -D_FORTIFY_SOURCE=2" >> configparms
|
||||||
|
echo "CXX += -fstack-protector-strong -D_FORTIFY_SOURCE=2" >> configparms
|
||||||
|
make
|
||||||
|
|
||||||
|
# remove harding in preparation to run test-suite
|
||||||
|
sed -i '5,7d' configparms
|
||||||
|
}
|
||||||
|
|
||||||
|
check() {
|
||||||
|
# the linker commands need to be reordered - fixed in 2.19
|
||||||
|
LDFLAGS=${LDFLAGS/--as-needed,/}
|
||||||
|
|
||||||
|
cd ${srcdir}/glibc-build
|
||||||
|
|
||||||
|
# tst-cleanupx4 failure on i686 is "expected"
|
||||||
|
make check || true
|
||||||
|
}
|
||||||
|
|
||||||
|
package() {
|
||||||
|
cd ${srcdir}/glibc-build
|
||||||
|
|
||||||
|
install -dm755 ${pkgdir}/etc
|
||||||
|
touch ${pkgdir}/etc/ld.so.conf
|
||||||
|
|
||||||
|
make install_root=${pkgdir} install
|
||||||
|
|
||||||
|
rm -f ${pkgdir}/etc/ld.so.{cache,conf}
|
||||||
|
|
||||||
|
install -dm755 ${pkgdir}/usr/lib/{locale,systemd/system,tmpfiles.d}
|
||||||
|
|
||||||
|
install -m644 ${srcdir}/${pkgname}-${pkgver}/nscd/nscd.conf ${pkgdir}/etc/nscd.conf
|
||||||
|
install -m644 ${srcdir}/${pkgname}-${pkgver}/nscd/nscd.service ${pkgdir}/usr/lib/systemd/system
|
||||||
|
install -m644 ${srcdir}/${pkgname}-${pkgver}/nscd/nscd.tmpfiles ${pkgdir}/usr/lib/tmpfiles.d/nscd.conf
|
||||||
|
|
||||||
|
install -m644 ${srcdir}/${pkgname}-${pkgver}/posix/gai.conf ${pkgdir}/etc/gai.conf
|
||||||
|
|
||||||
|
install -m755 ${srcdir}/locale-gen ${pkgdir}/usr/bin
|
||||||
|
|
||||||
|
# create /etc/locale.gen
|
||||||
|
install -m644 ${srcdir}/locale.gen.txt ${pkgdir}/etc/locale.gen
|
||||||
|
sed -e '1,3d' -e 's|/| |g' -e 's|\\| |g' -e 's|^|#|g' \
|
||||||
|
${srcdir}/glibc-${pkgver}/localedata/SUPPORTED >> ${pkgdir}/etc/locale.gen
|
||||||
|
|
||||||
|
# remove the static libraries that have a shared counterpart
|
||||||
|
# libc, libdl, libm and libpthread are required for toolchain testsuites
|
||||||
|
# in addition libcrypt appears widely required
|
||||||
|
rm $pkgdir/usr/lib/lib{anl,BrokenLocale,nsl,resolv,rt,util}.a
|
||||||
|
|
||||||
|
# Do not strip the following files for improved debugging support
|
||||||
|
# ("improved" as in not breaking gdb and valgrind...):
|
||||||
|
# ld-${pkgver}.so
|
||||||
|
# libc-${pkgver}.so
|
||||||
|
# libpthread-${pkgver}.so
|
||||||
|
# libthread_db-1.0.so
|
||||||
|
|
||||||
|
cd $pkgdir
|
||||||
|
strip $STRIP_BINARIES usr/bin/{gencat,getconf,getent,iconv,iconvconfig} \
|
||||||
|
usr/bin/{ldconfig,locale,localedef,nscd,makedb} \
|
||||||
|
usr/bin/{pcprofiledump,pldd,rpcgen,sln,sprof} \
|
||||||
|
usr/lib/getconf/*
|
||||||
|
[[ $CARCH = "i686" ]] && strip $STRIP_BINARIES usr/bin/lddlibc4
|
||||||
|
|
||||||
|
strip $STRIP_STATIC usr/lib/*.a
|
||||||
|
|
||||||
|
strip $STRIP_SHARED usr/lib/{libanl,libBrokenLocale,libcidn,libcrypt}-*.so \
|
||||||
|
usr/lib/libnss_{compat,db,dns,files,hesiod,nis,nisplus}-*.so \
|
||||||
|
usr/lib/{libdl,libm,libnsl,libresolv,librt,libutil}-*.so \
|
||||||
|
usr/lib/{libmemusage,libpcprofile,libSegFault}.so \
|
||||||
|
usr/lib/{audit,gconv}/*.so
|
||||||
|
}
|
389
vendor/github.com/mikkeloscar/gopkgbuild/test_pkgbuilds/PKGBUILD_grub
generated
vendored
Normal file
389
vendor/github.com/mikkeloscar/gopkgbuild/test_pkgbuilds/PKGBUILD_grub
generated
vendored
Normal file
|
@ -0,0 +1,389 @@
|
||||||
|
# Maintainer : Tobias Powalowski <tpowa@archlinux.org>
|
||||||
|
# Maintainer : Ronald van Haren <ronald.archlinux.org>
|
||||||
|
# Contributor: Keshav Amburay <(the ddoott ridikulus ddoott rat) (aatt) (gemmaeiil) (ddoott) (ccoomm)>
|
||||||
|
|
||||||
|
## "1" to enable IA32-EFI build in Arch x86_64, "0" to disable
|
||||||
|
_IA32_EFI_IN_ARCH_X64="1"
|
||||||
|
|
||||||
|
## "1" to enable EMU build, "0" to disable
|
||||||
|
_GRUB_EMU_BUILD="0"
|
||||||
|
|
||||||
|
_pkgver="2.02"
|
||||||
|
_GRUB_GIT_TAG="grub-2.02-beta2"
|
||||||
|
|
||||||
|
_UNIFONT_VER="6.3.20131217"
|
||||||
|
|
||||||
|
[[ "${CARCH}" == "x86_64" ]] && _EFI_ARCH="x86_64"
|
||||||
|
[[ "${CARCH}" == "i686" ]] && _EFI_ARCH="i386"
|
||||||
|
|
||||||
|
[[ "${CARCH}" == "x86_64" ]] && _EMU_ARCH="x86_64"
|
||||||
|
[[ "${CARCH}" == "i686" ]] && _EMU_ARCH="i386"
|
||||||
|
|
||||||
|
pkgname="grub"
|
||||||
|
pkgdesc="GNU GRand Unified Bootloader (2)"
|
||||||
|
pkgver=2.02.beta2
|
||||||
|
pkgrel=5
|
||||||
|
epoch="1"
|
||||||
|
url="https://www.gnu.org/software/grub/"
|
||||||
|
arch=('x86_64' 'i686')
|
||||||
|
license=('GPL3')
|
||||||
|
backup=('boot/grub/grub.cfg' 'etc/default/grub' 'etc/grub.d/40_custom')
|
||||||
|
install="${pkgname}.install"
|
||||||
|
options=('!makeflags')
|
||||||
|
|
||||||
|
conflicts=('grub-common' 'grub-bios' 'grub-emu' "grub-efi-${_EFI_ARCH}" 'grub-legacy')
|
||||||
|
replaces=('grub-common' 'grub-bios' 'grub-emu' "grub-efi-${_EFI_ARCH}")
|
||||||
|
provides=('grub-common' 'grub-bios' 'grub-emu' "grub-efi-${_EFI_ARCH}")
|
||||||
|
|
||||||
|
makedepends=('git' 'rsync' 'xz' 'freetype2' 'ttf-dejavu' 'python' 'autogen'
|
||||||
|
'texinfo' 'help2man' 'gettext' 'device-mapper' 'fuse')
|
||||||
|
depends=('sh' 'xz' 'gettext' 'device-mapper')
|
||||||
|
optdepends=('freetype2: For grub-mkfont usage'
|
||||||
|
'fuse: For grub-mount usage'
|
||||||
|
'dosfstools: For grub-mkrescue FAT FS and EFI support'
|
||||||
|
'efibootmgr: For grub-install EFI support'
|
||||||
|
'libisoburn: Provides xorriso for generating grub rescue iso using grub-mkrescue'
|
||||||
|
'os-prober: To detect other OSes when generating grub.cfg in BIOS systems'
|
||||||
|
'mtools: For grub-mkrescue FAT FS support')
|
||||||
|
|
||||||
|
if [[ "${_GRUB_EMU_BUILD}" == "1" ]]; then
|
||||||
|
makedepends+=('libusbx' 'sdl')
|
||||||
|
optdepends+=('libusbx: For grub-emu USB support'
|
||||||
|
'sdl: For grub-emu SDL support')
|
||||||
|
fi
|
||||||
|
|
||||||
|
source=("grub-${_pkgver}::git+git://git.sv.gnu.org/grub.git#tag=${_GRUB_GIT_TAG}"
|
||||||
|
"grub-extras::git+git://git.sv.gnu.org/grub-extras.git#branch=master"
|
||||||
|
"http://ftp.gnu.org/gnu/unifont/unifont-${_UNIFONT_VER}/unifont-${_UNIFONT_VER}.bdf.gz"
|
||||||
|
"http://ftp.gnu.org/gnu/unifont/unifont-${_UNIFONT_VER}/unifont-${_UNIFONT_VER}.bdf.gz.sig"
|
||||||
|
'grub-10_linux-detect-archlinux-initramfs.patch'
|
||||||
|
'grub-intel-ucode.patch'
|
||||||
|
'grub-add-GRUB_COLOR_variables.patch'
|
||||||
|
'60_memtest86+'
|
||||||
|
'grub.default'
|
||||||
|
'grub.cfg')
|
||||||
|
|
||||||
|
md5sums=('SKIP'
|
||||||
|
'SKIP'
|
||||||
|
'728b7439ac733a7c0d56049adec364c7'
|
||||||
|
'SKIP'
|
||||||
|
'945527e0de8d384166a4cf23439ae9ee'
|
||||||
|
'a678629bc82c4e70c48d28242036d1d7'
|
||||||
|
'e506ae4a9f9f7d1b765febfa84e10d48'
|
||||||
|
'be55eabc102f2c60b38ed35c203686d6'
|
||||||
|
'a03ffd56324520393bf574cefccb893d'
|
||||||
|
'c8b9511586d57d6f2524ae7898397a46')
|
||||||
|
|
||||||
|
_pkgver() {
|
||||||
|
cd "${srcdir}/grub-${_pkgver}/"
|
||||||
|
echo "$(git describe --tags)" | sed -e 's|grub.||g' -e 's|-|\.|g'
|
||||||
|
}
|
||||||
|
|
||||||
|
prepare() {
|
||||||
|
|
||||||
|
cd "${srcdir}/grub-${_pkgver}/"
|
||||||
|
|
||||||
|
msg "Patch to load Intel microcode"
|
||||||
|
patch -Np1 -i "${srcdir}/grub-intel-ucode.patch"
|
||||||
|
echo
|
||||||
|
|
||||||
|
msg "Patch to detect of Arch Linux initramfs images by grub-mkconfig"
|
||||||
|
patch -Np1 -i "${srcdir}/grub-10_linux-detect-archlinux-initramfs.patch"
|
||||||
|
echo
|
||||||
|
|
||||||
|
msg "Patch to enable GRUB_COLOR_* variables in grub-mkconfig"
|
||||||
|
## Based on http://lists.gnu.org/archive/html/grub-devel/2012-02/msg00021.html
|
||||||
|
patch -Np1 -i "${srcdir}/grub-add-GRUB_COLOR_variables.patch"
|
||||||
|
echo
|
||||||
|
|
||||||
|
msg "Fix DejaVuSans.ttf location so that grub-mkfont can create *.pf2 files for starfield theme"
|
||||||
|
sed 's|/usr/share/fonts/dejavu|/usr/share/fonts/dejavu /usr/share/fonts/TTF|g' -i "${srcdir}/grub-${_pkgver}/configure.ac"
|
||||||
|
|
||||||
|
msg "Fix mkinitcpio 'rw' FS#36275"
|
||||||
|
sed 's| ro | rw |g' -i "${srcdir}/grub-${_pkgver}/util/grub.d/10_linux.in"
|
||||||
|
|
||||||
|
msg "Fix OS naming FS#33393"
|
||||||
|
sed 's|GNU/Linux|Linux|' -i "${srcdir}/grub-${_pkgver}/util/grub.d/10_linux.in"
|
||||||
|
|
||||||
|
# msg "autogen.sh requires python (2/3). since bzr is in makedepends, use python2 and no need to pull python3"
|
||||||
|
# sed 's|python |python2 |g' -i "${srcdir}/grub-${_pkgver}/autogen.sh"
|
||||||
|
|
||||||
|
msg "Pull in latest language files"
|
||||||
|
./linguas.sh
|
||||||
|
echo
|
||||||
|
|
||||||
|
msg "Remove not working langs which need LC_ALL=C.UTF-8"
|
||||||
|
sed -e 's#en@cyrillic en@greek##g' -i "${srcdir}/grub-${_pkgver}/po/LINGUAS"
|
||||||
|
|
||||||
|
msg "Avoid problem with unifont during compile of grub, http://savannah.gnu.org/bugs/?40330 and https://bugs.archlinux.org/task/37847"
|
||||||
|
cp "${srcdir}/unifont-${_UNIFONT_VER}.bdf" "${srcdir}/grub-${_pkgver}/unifont.bdf"
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
_build_grub-common_and_bios() {
|
||||||
|
|
||||||
|
msg "Set ARCH dependent variables for bios build"
|
||||||
|
if [[ "${CARCH}" == 'x86_64' ]]; then
|
||||||
|
_EFIEMU="--enable-efiemu"
|
||||||
|
else
|
||||||
|
_EFIEMU="--disable-efiemu"
|
||||||
|
fi
|
||||||
|
|
||||||
|
msg "Copy the source for building the bios part"
|
||||||
|
cp -r "${srcdir}/grub-${_pkgver}" "${srcdir}/grub-${_pkgver}-bios"
|
||||||
|
cd "${srcdir}/grub-${_pkgver}-bios/"
|
||||||
|
|
||||||
|
msg "Add the grub-extra sources for bios build"
|
||||||
|
install -d "${srcdir}/grub-${_pkgver}-bios/grub-extras"
|
||||||
|
cp -r "${srcdir}/grub-extras/915resolution" "${srcdir}/grub-${_pkgver}-bios/grub-extras/915resolution"
|
||||||
|
export GRUB_CONTRIB="${srcdir}/grub-${_pkgver}-bios/grub-extras/"
|
||||||
|
|
||||||
|
msg "Unset all compiler FLAGS for bios build"
|
||||||
|
unset CFLAGS
|
||||||
|
unset CPPFLAGS
|
||||||
|
unset CXXFLAGS
|
||||||
|
unset LDFLAGS
|
||||||
|
unset MAKEFLAGS
|
||||||
|
|
||||||
|
cd "${srcdir}/grub-${_pkgver}-bios/"
|
||||||
|
|
||||||
|
msg "Run autogen.sh for bios build"
|
||||||
|
./autogen.sh
|
||||||
|
echo
|
||||||
|
|
||||||
|
msg "Run ./configure for bios build"
|
||||||
|
./configure \
|
||||||
|
--with-platform="pc" \
|
||||||
|
--target="i386" \
|
||||||
|
"${_EFIEMU}" \
|
||||||
|
--enable-mm-debug \
|
||||||
|
--enable-nls \
|
||||||
|
--enable-device-mapper \
|
||||||
|
--enable-cache-stats \
|
||||||
|
--enable-boot-time \
|
||||||
|
--enable-grub-mkfont \
|
||||||
|
--enable-grub-mount \
|
||||||
|
--prefix="/usr" \
|
||||||
|
--bindir="/usr/bin" \
|
||||||
|
--sbindir="/usr/bin" \
|
||||||
|
--mandir="/usr/share/man" \
|
||||||
|
--infodir="/usr/share/info" \
|
||||||
|
--datarootdir="/usr/share" \
|
||||||
|
--sysconfdir="/etc" \
|
||||||
|
--program-prefix="" \
|
||||||
|
--with-bootdir="/boot" \
|
||||||
|
--with-grubdir="grub" \
|
||||||
|
--disable-silent-rules \
|
||||||
|
--disable-werror
|
||||||
|
echo
|
||||||
|
|
||||||
|
msg "Run make for bios build"
|
||||||
|
make
|
||||||
|
echo
|
||||||
|
}
|
||||||
|
|
||||||
|
_build_grub-efi() {
|
||||||
|
|
||||||
|
msg "Copy the source for building the ${_EFI_ARCH} efi part"
|
||||||
|
cp -r "${srcdir}/grub-${_pkgver}" "${srcdir}/grub-${_pkgver}-efi-${_EFI_ARCH}"
|
||||||
|
cd "${srcdir}/grub-${_pkgver}-efi-${_EFI_ARCH}/"
|
||||||
|
|
||||||
|
msg "Unset all compiler FLAGS for ${_EFI_ARCH} efi build"
|
||||||
|
unset CFLAGS
|
||||||
|
unset CPPFLAGS
|
||||||
|
unset CXXFLAGS
|
||||||
|
unset LDFLAGS
|
||||||
|
unset MAKEFLAGS
|
||||||
|
|
||||||
|
cd "${srcdir}/grub-${_pkgver}-efi-${_EFI_ARCH}/"
|
||||||
|
|
||||||
|
msg "Run autogen.sh for ${_EFI_ARCH} efi build"
|
||||||
|
./autogen.sh
|
||||||
|
echo
|
||||||
|
|
||||||
|
msg "Run ./configure for ${_EFI_ARCH} efi build"
|
||||||
|
./configure \
|
||||||
|
--with-platform="efi" \
|
||||||
|
--target="${_EFI_ARCH}" \
|
||||||
|
--disable-efiemu \
|
||||||
|
--enable-mm-debug \
|
||||||
|
--enable-nls \
|
||||||
|
--enable-device-mapper \
|
||||||
|
--enable-cache-stats \
|
||||||
|
--enable-boot-time \
|
||||||
|
--enable-grub-mkfont \
|
||||||
|
--enable-grub-mount \
|
||||||
|
--prefix="/usr" \
|
||||||
|
--bindir="/usr/bin" \
|
||||||
|
--sbindir="/usr/bin" \
|
||||||
|
--mandir="/usr/share/man" \
|
||||||
|
--infodir="/usr/share/info" \
|
||||||
|
--datarootdir="/usr/share" \
|
||||||
|
--sysconfdir="/etc" \
|
||||||
|
--program-prefix="" \
|
||||||
|
--with-bootdir="/boot" \
|
||||||
|
--with-grubdir="grub" \
|
||||||
|
--disable-silent-rules \
|
||||||
|
--disable-werror
|
||||||
|
echo
|
||||||
|
|
||||||
|
msg "Run make for ${_EFI_ARCH} efi build"
|
||||||
|
make
|
||||||
|
echo
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
_build_grub-emu() {
|
||||||
|
|
||||||
|
msg "Copy the source for building the emu part"
|
||||||
|
cp -r "${srcdir}/grub-${_pkgver}/" "${srcdir}/grub-${_pkgver}-emu/"
|
||||||
|
|
||||||
|
msg "Unset all compiler FLAGS for emu build"
|
||||||
|
unset CFLAGS
|
||||||
|
unset CPPFLAGS
|
||||||
|
unset CXXFLAGS
|
||||||
|
unset LDFLAGS
|
||||||
|
unset MAKEFLAGS
|
||||||
|
|
||||||
|
cd "${srcdir}/grub-${_pkgver}-emu/"
|
||||||
|
|
||||||
|
msg "Run autogen.sh for emu build"
|
||||||
|
./autogen.sh
|
||||||
|
echo
|
||||||
|
|
||||||
|
msg "Run ./configure for emu build"
|
||||||
|
./configure \
|
||||||
|
--with-platform="emu" \
|
||||||
|
--target="${_EMU_ARCH}" \
|
||||||
|
--enable-mm-debug \
|
||||||
|
--enable-nls \
|
||||||
|
--enable-device-mapper \
|
||||||
|
--enable-cache-stats \
|
||||||
|
--enable-grub-mkfont \
|
||||||
|
--enable-grub-mount \
|
||||||
|
--enable-grub-emu-usb=no \
|
||||||
|
--enable-grub-emu-sdl=no \
|
||||||
|
--disable-grub-emu-pci \
|
||||||
|
--prefix="/usr" \
|
||||||
|
--bindir="/usr/bin" \
|
||||||
|
--sbindir="/usr/bin" \
|
||||||
|
--mandir="/usr/share/man" \
|
||||||
|
--infodir="/usr/share/info" \
|
||||||
|
--datarootdir="/usr/share" \
|
||||||
|
--sysconfdir="/etc" \
|
||||||
|
--program-prefix="" \
|
||||||
|
--with-bootdir="/boot" \
|
||||||
|
--with-grubdir="grub" \
|
||||||
|
--disable-silent-rules \
|
||||||
|
--disable-werror
|
||||||
|
echo
|
||||||
|
|
||||||
|
msg "Run make for emu build"
|
||||||
|
make
|
||||||
|
echo
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
build() {
|
||||||
|
|
||||||
|
cd "${srcdir}/grub-${_pkgver}/"
|
||||||
|
|
||||||
|
msg "Build grub bios stuff"
|
||||||
|
_build_grub-common_and_bios
|
||||||
|
echo
|
||||||
|
|
||||||
|
msg "Build grub ${_EFI_ARCH} efi stuff"
|
||||||
|
_build_grub-efi
|
||||||
|
echo
|
||||||
|
|
||||||
|
if [[ "${CARCH}" == "x86_64" ]] && [[ "${_IA32_EFI_IN_ARCH_X64}" == "1" ]]; then
|
||||||
|
msg "Build grub i386 efi stuff"
|
||||||
|
_EFI_ARCH="i386" _build_grub-efi
|
||||||
|
echo
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "${_GRUB_EMU_BUILD}" == "1" ]]; then
|
||||||
|
msg "Build grub emu stuff"
|
||||||
|
_build_grub-emu
|
||||||
|
echo
|
||||||
|
fi
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
_package_grub-common_and_bios() {
|
||||||
|
|
||||||
|
cd "${srcdir}/grub-${_pkgver}-bios/"
|
||||||
|
|
||||||
|
msg "Run make install for bios build"
|
||||||
|
make DESTDIR="${pkgdir}/" bashcompletiondir="/usr/share/bash-completion/completions" install
|
||||||
|
echo
|
||||||
|
|
||||||
|
msg "Remove gdb debugging related files for bios build"
|
||||||
|
rm -f "${pkgdir}/usr/lib/grub/i386-pc"/*.module || true
|
||||||
|
rm -f "${pkgdir}/usr/lib/grub/i386-pc"/*.image || true
|
||||||
|
rm -f "${pkgdir}/usr/lib/grub/i386-pc"/{kernel.exec,gdb_grub,gmodule.pl} || true
|
||||||
|
|
||||||
|
msg "Install extra /etc/grub.d/ files"
|
||||||
|
install -D -m0755 "${srcdir}/60_memtest86+" "${pkgdir}/etc/grub.d/60_memtest86+"
|
||||||
|
|
||||||
|
msg "Install /etc/default/grub (used by grub-mkconfig)"
|
||||||
|
install -D -m0644 "${srcdir}/grub.default" "${pkgdir}/etc/default/grub"
|
||||||
|
|
||||||
|
msg "Install grub.cfg for backup array"
|
||||||
|
install -D -m0644 "${srcdir}/grub.cfg" "${pkgdir}/boot/grub/grub.cfg"
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
_package_grub-efi() {
|
||||||
|
|
||||||
|
cd "${srcdir}/grub-${_pkgver}-efi-${_EFI_ARCH}/"
|
||||||
|
|
||||||
|
msg "Run make install for ${_EFI_ARCH} efi build"
|
||||||
|
make DESTDIR="${pkgdir}/" bashcompletiondir="/usr/share/bash-completion/completions" install
|
||||||
|
echo
|
||||||
|
|
||||||
|
msg "Remove gdb debugging related files for ${_EFI_ARCH} efi build"
|
||||||
|
rm -f "${pkgdir}/usr/lib/grub/${_EFI_ARCH}-efi"/*.module || true
|
||||||
|
rm -f "${pkgdir}/usr/lib/grub/${_EFI_ARCH}-efi"/*.image || true
|
||||||
|
rm -f "${pkgdir}/usr/lib/grub/${_EFI_ARCH}-efi"/{kernel.exec,gdb_grub,gmodule.pl} || true
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
_package_grub-emu() {
|
||||||
|
|
||||||
|
cd "${srcdir}/grub-${_pkgver}-emu/"
|
||||||
|
|
||||||
|
msg "Run make install for emu build"
|
||||||
|
make DESTDIR="${pkgdir}/" bashcompletiondir="/usr/share/bash-completion/completions" install
|
||||||
|
echo
|
||||||
|
|
||||||
|
msg "Remove gdb debugging related files for emu build"
|
||||||
|
rm -f "${pkgdir}/usr/lib/grub/${_EMU_ARCH}-emu"/*.module || true
|
||||||
|
rm -f "${pkgdir}/usr/lib/grub/${_EMU_ARCH}-emu"/*.image || true
|
||||||
|
rm -f "${pkgdir}/usr/lib/grub/${_EMU_ARCH}-emu"/{kernel.exec,gdb_grub,gmodule.pl} || true
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
package() {
|
||||||
|
|
||||||
|
cd "${srcdir}/grub-${_pkgver}/"
|
||||||
|
|
||||||
|
msg "Package grub ${_EFI_ARCH} efi stuff"
|
||||||
|
_package_grub-efi
|
||||||
|
|
||||||
|
if [[ "${CARCH}" == "x86_64" ]] && [[ "${_IA32_EFI_IN_ARCH_X64}" == "1" ]]; then
|
||||||
|
msg "Package grub i386 efi stuff"
|
||||||
|
_EFI_ARCH="i386" _package_grub-efi
|
||||||
|
echo
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "${_GRUB_EMU_BUILD}" == "1" ]]; then
|
||||||
|
msg "Package grub emu stuff"
|
||||||
|
_package_grub-emu
|
||||||
|
echo
|
||||||
|
fi
|
||||||
|
|
||||||
|
msg "Package grub bios stuff"
|
||||||
|
_package_grub-common_and_bios
|
||||||
|
|
||||||
|
}
|
301
vendor/github.com/mikkeloscar/gopkgbuild/test_pkgbuilds/PKGBUILD_linux
generated
vendored
Normal file
301
vendor/github.com/mikkeloscar/gopkgbuild/test_pkgbuilds/PKGBUILD_linux
generated
vendored
Normal file
|
@ -0,0 +1,301 @@
|
||||||
|
# $Id: PKGBUILD 230158 2015-01-28 07:08:45Z tpowa $
|
||||||
|
# Maintainer: Tobias Powalowski <tpowa@archlinux.org>
|
||||||
|
# Maintainer: Thomas Baechler <thomas@archlinux.org>
|
||||||
|
|
||||||
|
pkgbase=linux # Build stock -ARCH kernel
|
||||||
|
#pkgbase=linux-custom # Build kernel with a different name
|
||||||
|
_srcname=linux-3.18
|
||||||
|
pkgver=3.18.4
|
||||||
|
pkgrel=1
|
||||||
|
arch=('i686' 'x86_64')
|
||||||
|
url="http://www.kernel.org/"
|
||||||
|
license=('GPL2')
|
||||||
|
makedepends=('xmlto' 'docbook-xsl' 'kmod' 'inetutils' 'bc')
|
||||||
|
options=('!strip')
|
||||||
|
source=("https://www.kernel.org/pub/linux/kernel/v3.x/${_srcname}.tar.xz"
|
||||||
|
"https://www.kernel.org/pub/linux/kernel/v3.x/${_srcname}.tar.sign"
|
||||||
|
"https://www.kernel.org/pub/linux/kernel/v3.x/patch-${pkgver}.xz"
|
||||||
|
"https://www.kernel.org/pub/linux/kernel/v3.x/patch-${pkgver}.sign"
|
||||||
|
# the main kernel config files
|
||||||
|
'config' 'config.x86_64'
|
||||||
|
# standard config files for mkinitcpio ramdisk
|
||||||
|
'linux.preset'
|
||||||
|
'change-default-console-loglevel.patch'
|
||||||
|
)
|
||||||
|
sha256sums=('becc413cc9e6d7f5cc52a3ce66d65c3725bc1d1cc1001f4ce6c32b69eb188cbd'
|
||||||
|
'SKIP'
|
||||||
|
'57c74ba5266bb10be335a89d30480739b3de67b5a72b3e0b0d37a27775b1862a'
|
||||||
|
'SKIP'
|
||||||
|
'd3794c8b2cd11b71914b41f7a4e861369d4fa3c29fdd9e1d677ff0c2167eeb52'
|
||||||
|
'df7886f5d57f8f85e89987066dfa5c316e922dc0b22e6e6ad01331333db52377'
|
||||||
|
'f0d90e756f14533ee67afda280500511a62465b4f76adcc5effa95a40045179c'
|
||||||
|
'1256b241cd477b265a3c2d64bdc19ffe3c9bbcee82ea3994c590c2c76e767d99')
|
||||||
|
validpgpkeys=(
|
||||||
|
'ABAF11C65A2970B130ABE3C479BE3E4300411886' # Linus Torvalds
|
||||||
|
'647F28654894E3BD457199BE38DBBDC86092693E' # Greg Kroah-Hartman
|
||||||
|
)
|
||||||
|
|
||||||
|
_kernelname=${pkgbase#linux}
|
||||||
|
|
||||||
|
prepare() {
|
||||||
|
cd "${srcdir}/${_srcname}"
|
||||||
|
|
||||||
|
# add upstream patch
|
||||||
|
patch -p1 -i "${srcdir}/patch-${pkgver}"
|
||||||
|
|
||||||
|
# add latest fixes from stable queue, if needed
|
||||||
|
# http://git.kernel.org/?p=linux/kernel/git/stable/stable-queue.git
|
||||||
|
|
||||||
|
# set DEFAULT_CONSOLE_LOGLEVEL to 4 (same value as the 'quiet' kernel param)
|
||||||
|
# remove this when a Kconfig knob is made available by upstream
|
||||||
|
# (relevant patch sent upstream: https://lkml.org/lkml/2011/7/26/227)
|
||||||
|
patch -p1 -i "${srcdir}/change-default-console-loglevel.patch"
|
||||||
|
|
||||||
|
if [ "${CARCH}" = "x86_64" ]; then
|
||||||
|
cat "${srcdir}/config.x86_64" > ./.config
|
||||||
|
else
|
||||||
|
cat "${srcdir}/config" > ./.config
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "${_kernelname}" != "" ]; then
|
||||||
|
sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_kernelname}\"|g" ./.config
|
||||||
|
sed -i "s|CONFIG_LOCALVERSION_AUTO=.*|CONFIG_LOCALVERSION_AUTO=n|" ./.config
|
||||||
|
fi
|
||||||
|
|
||||||
|
# set extraversion to pkgrel
|
||||||
|
sed -ri "s|^(EXTRAVERSION =).*|\1 -${pkgrel}|" Makefile
|
||||||
|
|
||||||
|
# don't run depmod on 'make install'. We'll do this ourselves in packaging
|
||||||
|
sed -i '2iexit 0' scripts/depmod.sh
|
||||||
|
|
||||||
|
# get kernel version
|
||||||
|
make prepare
|
||||||
|
|
||||||
|
# load configuration
|
||||||
|
# Configure the kernel. Replace the line below with one of your choice.
|
||||||
|
#make menuconfig # CLI menu for configuration
|
||||||
|
#make nconfig # new CLI menu for configuration
|
||||||
|
#make xconfig # X-based configuration
|
||||||
|
#make oldconfig # using old config from previous kernel version
|
||||||
|
# ... or manually edit .config
|
||||||
|
|
||||||
|
# rewrite configuration
|
||||||
|
yes "" | make config >/dev/null
|
||||||
|
}
|
||||||
|
|
||||||
|
build() {
|
||||||
|
cd "${srcdir}/${_srcname}"
|
||||||
|
|
||||||
|
make ${MAKEFLAGS} LOCALVERSION= bzImage modules
|
||||||
|
}
|
||||||
|
|
||||||
|
_package() {
|
||||||
|
pkgdesc="The ${pkgbase/linux/Linux} kernel and modules"
|
||||||
|
[ "${pkgbase}" = "linux" ] && groups=('base')
|
||||||
|
depends=('coreutils' 'linux-firmware' 'kmod' 'mkinitcpio>=0.7')
|
||||||
|
optdepends=('crda: to set the correct wireless channels of your country')
|
||||||
|
provides=("kernel26${_kernelname}=${pkgver}")
|
||||||
|
conflicts=("kernel26${_kernelname}")
|
||||||
|
replaces=("kernel26${_kernelname}")
|
||||||
|
backup=("etc/mkinitcpio.d/${pkgbase}.preset")
|
||||||
|
install=linux.install
|
||||||
|
|
||||||
|
cd "${srcdir}/${_srcname}"
|
||||||
|
|
||||||
|
KARCH=x86
|
||||||
|
|
||||||
|
# get kernel version
|
||||||
|
_kernver="$(make LOCALVERSION= kernelrelease)"
|
||||||
|
_basekernel=${_kernver%%-*}
|
||||||
|
_basekernel=${_basekernel%.*}
|
||||||
|
|
||||||
|
mkdir -p "${pkgdir}"/{lib/modules,lib/firmware,boot}
|
||||||
|
make LOCALVERSION= INSTALL_MOD_PATH="${pkgdir}" modules_install
|
||||||
|
cp arch/$KARCH/boot/bzImage "${pkgdir}/boot/vmlinuz-${pkgbase}"
|
||||||
|
|
||||||
|
# set correct depmod command for install
|
||||||
|
cp -f "${startdir}/${install}" "${startdir}/${install}.pkg"
|
||||||
|
true && install=${install}.pkg
|
||||||
|
sed \
|
||||||
|
-e "s/KERNEL_NAME=.*/KERNEL_NAME=${_kernelname}/" \
|
||||||
|
-e "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/" \
|
||||||
|
-i "${startdir}/${install}"
|
||||||
|
|
||||||
|
# install mkinitcpio preset file for kernel
|
||||||
|
install -D -m644 "${srcdir}/linux.preset" "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset"
|
||||||
|
sed \
|
||||||
|
-e "1s|'linux.*'|'${pkgbase}'|" \
|
||||||
|
-e "s|ALL_kver=.*|ALL_kver=\"/boot/vmlinuz-${pkgbase}\"|" \
|
||||||
|
-e "s|default_image=.*|default_image=\"/boot/initramfs-${pkgbase}.img\"|" \
|
||||||
|
-e "s|fallback_image=.*|fallback_image=\"/boot/initramfs-${pkgbase}-fallback.img\"|" \
|
||||||
|
-i "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset"
|
||||||
|
|
||||||
|
# remove build and source links
|
||||||
|
rm -f "${pkgdir}"/lib/modules/${_kernver}/{source,build}
|
||||||
|
# remove the firmware
|
||||||
|
rm -rf "${pkgdir}/lib/firmware"
|
||||||
|
# gzip -9 all modules to save 100MB of space
|
||||||
|
find "${pkgdir}" -name '*.ko' -exec gzip -9 {} \;
|
||||||
|
# make room for external modules
|
||||||
|
ln -s "../extramodules-${_basekernel}${_kernelname:--ARCH}" "${pkgdir}/lib/modules/${_kernver}/extramodules"
|
||||||
|
# add real version for building modules and running depmod from post_install/upgrade
|
||||||
|
mkdir -p "${pkgdir}/lib/modules/extramodules-${_basekernel}${_kernelname:--ARCH}"
|
||||||
|
echo "${_kernver}" > "${pkgdir}/lib/modules/extramodules-${_basekernel}${_kernelname:--ARCH}/version"
|
||||||
|
|
||||||
|
# Now we call depmod...
|
||||||
|
depmod -b "${pkgdir}" -F System.map "${_kernver}"
|
||||||
|
|
||||||
|
# move module tree /lib -> /usr/lib
|
||||||
|
mkdir -p "${pkgdir}/usr"
|
||||||
|
mv "${pkgdir}/lib" "${pkgdir}/usr/"
|
||||||
|
|
||||||
|
# add vmlinux
|
||||||
|
install -D -m644 vmlinux "${pkgdir}/usr/lib/modules/${_kernver}/build/vmlinux"
|
||||||
|
}
|
||||||
|
|
||||||
|
_package-headers() {
|
||||||
|
pkgdesc="Header files and scripts for building modules for ${pkgbase/linux/Linux} kernel"
|
||||||
|
provides=("kernel26${_kernelname}-headers=${pkgver}")
|
||||||
|
conflicts=("kernel26${_kernelname}-headers")
|
||||||
|
replaces=("kernel26${_kernelname}-headers")
|
||||||
|
|
||||||
|
install -dm755 "${pkgdir}/usr/lib/modules/${_kernver}"
|
||||||
|
|
||||||
|
cd "${srcdir}/${_srcname}"
|
||||||
|
install -D -m644 Makefile \
|
||||||
|
"${pkgdir}/usr/lib/modules/${_kernver}/build/Makefile"
|
||||||
|
install -D -m644 kernel/Makefile \
|
||||||
|
"${pkgdir}/usr/lib/modules/${_kernver}/build/kernel/Makefile"
|
||||||
|
install -D -m644 .config \
|
||||||
|
"${pkgdir}/usr/lib/modules/${_kernver}/build/.config"
|
||||||
|
|
||||||
|
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/include"
|
||||||
|
|
||||||
|
for i in acpi asm-generic config crypto drm generated keys linux math-emu \
|
||||||
|
media net pcmcia scsi sound trace uapi video xen; do
|
||||||
|
cp -a include/${i} "${pkgdir}/usr/lib/modules/${_kernver}/build/include/"
|
||||||
|
done
|
||||||
|
|
||||||
|
# copy arch includes for external modules
|
||||||
|
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/x86"
|
||||||
|
cp -a arch/x86/include "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/x86/"
|
||||||
|
|
||||||
|
# copy files necessary for later builds, like nvidia and vmware
|
||||||
|
cp Module.symvers "${pkgdir}/usr/lib/modules/${_kernver}/build"
|
||||||
|
cp -a scripts "${pkgdir}/usr/lib/modules/${_kernver}/build"
|
||||||
|
|
||||||
|
# fix permissions on scripts dir
|
||||||
|
chmod og-w -R "${pkgdir}/usr/lib/modules/${_kernver}/build/scripts"
|
||||||
|
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/.tmp_versions"
|
||||||
|
|
||||||
|
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/kernel"
|
||||||
|
|
||||||
|
cp arch/${KARCH}/Makefile "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/"
|
||||||
|
|
||||||
|
if [ "${CARCH}" = "i686" ]; then
|
||||||
|
cp arch/${KARCH}/Makefile_32.cpu "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/"
|
||||||
|
fi
|
||||||
|
|
||||||
|
cp arch/${KARCH}/kernel/asm-offsets.s "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/kernel/"
|
||||||
|
|
||||||
|
# add docbook makefile
|
||||||
|
install -D -m644 Documentation/DocBook/Makefile \
|
||||||
|
"${pkgdir}/usr/lib/modules/${_kernver}/build/Documentation/DocBook/Makefile"
|
||||||
|
|
||||||
|
# add dm headers
|
||||||
|
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/md"
|
||||||
|
cp drivers/md/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/md"
|
||||||
|
|
||||||
|
# add inotify.h
|
||||||
|
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/include/linux"
|
||||||
|
cp include/linux/inotify.h "${pkgdir}/usr/lib/modules/${_kernver}/build/include/linux/"
|
||||||
|
|
||||||
|
# add wireless headers
|
||||||
|
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/net/mac80211/"
|
||||||
|
cp net/mac80211/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/net/mac80211/"
|
||||||
|
|
||||||
|
# add dvb headers for external modules
|
||||||
|
# in reference to:
|
||||||
|
# http://bugs.archlinux.org/task/9912
|
||||||
|
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-core"
|
||||||
|
cp drivers/media/dvb-core/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-core/"
|
||||||
|
# and...
|
||||||
|
# http://bugs.archlinux.org/task/11194
|
||||||
|
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/include/config/dvb/"
|
||||||
|
cp include/config/dvb/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/include/config/dvb/"
|
||||||
|
|
||||||
|
# add dvb headers for http://mcentral.de/hg/~mrec/em28xx-new
|
||||||
|
# in reference to:
|
||||||
|
# http://bugs.archlinux.org/task/13146
|
||||||
|
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-frontends/"
|
||||||
|
cp drivers/media/dvb-frontends/lgdt330x.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-frontends/"
|
||||||
|
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/i2c/"
|
||||||
|
cp drivers/media/i2c/msp3400-driver.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/i2c/"
|
||||||
|
|
||||||
|
# add dvb headers
|
||||||
|
# in reference to:
|
||||||
|
# http://bugs.archlinux.org/task/20402
|
||||||
|
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/usb/dvb-usb"
|
||||||
|
cp drivers/media/usb/dvb-usb/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/usb/dvb-usb/"
|
||||||
|
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-frontends"
|
||||||
|
cp drivers/media/dvb-frontends/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-frontends/"
|
||||||
|
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/tuners"
|
||||||
|
cp drivers/media/tuners/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/tuners/"
|
||||||
|
|
||||||
|
# add xfs and shmem for aufs building
|
||||||
|
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/fs/xfs"
|
||||||
|
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/mm"
|
||||||
|
# removed in 3.17 series
|
||||||
|
# cp fs/xfs/xfs_sb.h "${pkgdir}/usr/lib/modules/${_kernver}/build/fs/xfs/xfs_sb.h"
|
||||||
|
|
||||||
|
# copy in Kconfig files
|
||||||
|
for i in $(find . -name "Kconfig*"); do
|
||||||
|
mkdir -p "${pkgdir}"/usr/lib/modules/${_kernver}/build/`echo ${i} | sed 's|/Kconfig.*||'`
|
||||||
|
cp ${i} "${pkgdir}/usr/lib/modules/${_kernver}/build/${i}"
|
||||||
|
done
|
||||||
|
|
||||||
|
chown -R root.root "${pkgdir}/usr/lib/modules/${_kernver}/build"
|
||||||
|
find "${pkgdir}/usr/lib/modules/${_kernver}/build" -type d -exec chmod 755 {} \;
|
||||||
|
|
||||||
|
# strip scripts directory
|
||||||
|
find "${pkgdir}/usr/lib/modules/${_kernver}/build/scripts" -type f -perm -u+w 2>/dev/null | while read binary ; do
|
||||||
|
case "$(file -bi "${binary}")" in
|
||||||
|
*application/x-sharedlib*) # Libraries (.so)
|
||||||
|
/usr/bin/strip ${STRIP_SHARED} "${binary}";;
|
||||||
|
*application/x-archive*) # Libraries (.a)
|
||||||
|
/usr/bin/strip ${STRIP_STATIC} "${binary}";;
|
||||||
|
*application/x-executable*) # Binaries
|
||||||
|
/usr/bin/strip ${STRIP_BINARIES} "${binary}";;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
# remove unneeded architectures
|
||||||
|
rm -rf "${pkgdir}"/usr/lib/modules/${_kernver}/build/arch/{alpha,arc,arm,arm26,arm64,avr32,blackfin,c6x,cris,frv,h8300,hexagon,ia64,m32r,m68k,m68knommu,metag,mips,microblaze,mn10300,openrisc,parisc,powerpc,ppc,s390,score,sh,sh64,sparc,sparc64,tile,unicore32,um,v850,xtensa}
|
||||||
|
}
|
||||||
|
|
||||||
|
_package-docs() {
|
||||||
|
pkgdesc="Kernel hackers manual - HTML documentation that comes with the ${pkgbase/linux/Linux} kernel"
|
||||||
|
provides=("kernel26${_kernelname}-docs=${pkgver}")
|
||||||
|
conflicts=("kernel26${_kernelname}-docs")
|
||||||
|
replaces=("kernel26${_kernelname}-docs")
|
||||||
|
|
||||||
|
cd "${srcdir}/${_srcname}"
|
||||||
|
|
||||||
|
mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build"
|
||||||
|
cp -al Documentation "${pkgdir}/usr/lib/modules/${_kernver}/build"
|
||||||
|
find "${pkgdir}" -type f -exec chmod 444 {} \;
|
||||||
|
find "${pkgdir}" -type d -exec chmod 755 {} \;
|
||||||
|
|
||||||
|
# remove a file already in linux package
|
||||||
|
rm -f "${pkgdir}/usr/lib/modules/${_kernver}/build/Documentation/DocBook/Makefile"
|
||||||
|
}
|
||||||
|
|
||||||
|
pkgname=("${pkgbase}" "${pkgbase}-headers" "${pkgbase}-docs")
|
||||||
|
for _p in ${pkgname[@]}; do
|
||||||
|
eval "package_${_p}() {
|
||||||
|
$(declare -f "_package${_p#${pkgbase}}")
|
||||||
|
_package${_p#${pkgbase}}
|
||||||
|
}"
|
||||||
|
done
|
||||||
|
|
||||||
|
# vim:set ts=8 sts=2 sw=2 et:
|
88
vendor/github.com/mikkeloscar/gopkgbuild/test_pkgbuilds/PKGBUILD_openssh
generated
vendored
Normal file
88
vendor/github.com/mikkeloscar/gopkgbuild/test_pkgbuilds/PKGBUILD_openssh
generated
vendored
Normal file
|
@ -0,0 +1,88 @@
|
||||||
|
# $Id: PKGBUILD 224811 2014-10-18 18:33:28Z bisson $
|
||||||
|
# Maintainer: Gaetan Bisson <bisson@archlinux.org>
|
||||||
|
# Contributor: Aaron Griffin <aaron@archlinux.org>
|
||||||
|
# Contributor: judd <jvinet@zeroflux.org>
|
||||||
|
|
||||||
|
pkgname=openssh
|
||||||
|
pkgver=6.7p1
|
||||||
|
pkgrel=1
|
||||||
|
pkgdesc='Free version of the SSH connectivity tools'
|
||||||
|
url='http://www.openssh.org/portable.html'
|
||||||
|
license=('custom:BSD')
|
||||||
|
arch=('i686' 'x86_64')
|
||||||
|
makedepends=('linux-headers')
|
||||||
|
depends=('krb5' 'openssl' 'libedit' 'ldns')
|
||||||
|
optdepends=('xorg-xauth: X11 forwarding'
|
||||||
|
'x11-ssh-askpass: input passphrase in X')
|
||||||
|
source=("ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/${pkgname}-${pkgver}.tar.gz"{,.asc}
|
||||||
|
'sshdgenkeys.service'
|
||||||
|
'sshd@.service'
|
||||||
|
'sshd.service'
|
||||||
|
'sshd.socket'
|
||||||
|
'sshd.pam')
|
||||||
|
sha1sums=('14e5fbed710ade334d65925e080d1aaeb9c85bf6' 'SKIP'
|
||||||
|
'cc1ceec606c98c7407e7ac21ade23aed81e31405'
|
||||||
|
'6a0ff3305692cf83aca96e10f3bb51e1c26fccda'
|
||||||
|
'ec49c6beba923e201505f5669cea48cad29014db'
|
||||||
|
'e12fa910b26a5634e5a6ac39ce1399a132cf6796'
|
||||||
|
'd93dca5ebda4610ff7647187f8928a3de28703f3')
|
||||||
|
|
||||||
|
backup=('etc/ssh/ssh_config' 'etc/ssh/sshd_config' 'etc/pam.d/sshd')
|
||||||
|
|
||||||
|
install=install
|
||||||
|
|
||||||
|
build() {
|
||||||
|
cd "${srcdir}/${pkgname}-${pkgver}"
|
||||||
|
|
||||||
|
./configure \
|
||||||
|
--prefix=/usr \
|
||||||
|
--sbindir=/usr/bin \
|
||||||
|
--libexecdir=/usr/lib/ssh \
|
||||||
|
--sysconfdir=/etc/ssh \
|
||||||
|
--with-ldns \
|
||||||
|
--with-libedit \
|
||||||
|
--with-ssl-engine \
|
||||||
|
--with-pam \
|
||||||
|
--with-privsep-user=nobody \
|
||||||
|
--with-kerberos5=/usr \
|
||||||
|
--with-xauth=/usr/bin/xauth \
|
||||||
|
--with-mantype=man \
|
||||||
|
--with-md5-passwords \
|
||||||
|
--with-pid-dir=/run \
|
||||||
|
|
||||||
|
make
|
||||||
|
}
|
||||||
|
|
||||||
|
check() {
|
||||||
|
cd "${srcdir}/${pkgname}-${pkgver}"
|
||||||
|
|
||||||
|
make tests || true
|
||||||
|
# hard to suitably test connectivity:
|
||||||
|
# - fails with /bin/false as login shell
|
||||||
|
# - fails with firewall activated, etc.
|
||||||
|
}
|
||||||
|
|
||||||
|
package() {
|
||||||
|
cd "${srcdir}/${pkgname}-${pkgver}"
|
||||||
|
|
||||||
|
make DESTDIR="${pkgdir}" install
|
||||||
|
|
||||||
|
ln -sf ssh.1.gz "${pkgdir}"/usr/share/man/man1/slogin.1.gz
|
||||||
|
install -Dm644 LICENCE "${pkgdir}/usr/share/licenses/${pkgname}/LICENCE"
|
||||||
|
|
||||||
|
install -Dm644 ../sshdgenkeys.service "${pkgdir}"/usr/lib/systemd/system/sshdgenkeys.service
|
||||||
|
install -Dm644 ../sshd@.service "${pkgdir}"/usr/lib/systemd/system/sshd@.service
|
||||||
|
install -Dm644 ../sshd.service "${pkgdir}"/usr/lib/systemd/system/sshd.service
|
||||||
|
install -Dm644 ../sshd.socket "${pkgdir}"/usr/lib/systemd/system/sshd.socket
|
||||||
|
install -Dm644 ../sshd.pam "${pkgdir}"/etc/pam.d/sshd
|
||||||
|
|
||||||
|
install -Dm755 contrib/findssl.sh "${pkgdir}"/usr/bin/findssl.sh
|
||||||
|
install -Dm755 contrib/ssh-copy-id "${pkgdir}"/usr/bin/ssh-copy-id
|
||||||
|
install -Dm644 contrib/ssh-copy-id.1 "${pkgdir}"/usr/share/man/man1/ssh-copy-id.1
|
||||||
|
|
||||||
|
sed \
|
||||||
|
-e '/^#ChallengeResponseAuthentication yes$/c ChallengeResponseAuthentication no' \
|
||||||
|
-e '/^#PrintMotd yes$/c PrintMotd no # pam does that' \
|
||||||
|
-e '/^#UsePAM no$/c UsePAM yes' \
|
||||||
|
-i "${pkgdir}"/etc/ssh/sshd_config
|
||||||
|
}
|
96
vendor/github.com/mikkeloscar/gopkgbuild/test_pkgbuilds/PKGBUILD_pacman
generated
vendored
Normal file
96
vendor/github.com/mikkeloscar/gopkgbuild/test_pkgbuilds/PKGBUILD_pacman
generated
vendored
Normal file
|
@ -0,0 +1,96 @@
|
||||||
|
# vim: set ts=2 sw=2 et:
|
||||||
|
# $Id: PKGBUILD 227073 2014-11-25 01:56:16Z bisson $
|
||||||
|
# Maintainer: Dan McGee <dan@archlinux.org>
|
||||||
|
# Maintainer: Dave Reisner <dreisner@archlinux.org>
|
||||||
|
|
||||||
|
pkgname=pacman
|
||||||
|
pkgver=4.1.2
|
||||||
|
pkgrel=7
|
||||||
|
pkgdesc="A library-based package manager with dependency support"
|
||||||
|
arch=('i686' 'x86_64')
|
||||||
|
url="http://www.archlinux.org/pacman/"
|
||||||
|
license=('GPL')
|
||||||
|
groups=('base' 'base-devel')
|
||||||
|
depends=('bash>=4.2.042-2' 'glibc>=2.17-2' 'libarchive>=3.1.2' 'curl>=7.19.4'
|
||||||
|
'gpgme' 'pacman-mirrorlist' 'archlinux-keyring')
|
||||||
|
checkdepends=('python2' 'fakechroot')
|
||||||
|
optdepends=('fakeroot: for makepkg usage as normal user')
|
||||||
|
provides=('pacman-contrib')
|
||||||
|
conflicts=('pacman-contrib')
|
||||||
|
replaces=('pacman-contrib')
|
||||||
|
backup=(etc/pacman.conf etc/makepkg.conf)
|
||||||
|
options=('strip' 'debug')
|
||||||
|
source=(ftp://ftp.archlinux.org/other/pacman/$pkgname-$pkgver.tar.gz{,.sig}
|
||||||
|
0001-pacman-key-compatibility-with-gnupg-2.1.patch
|
||||||
|
pacman.conf.i686
|
||||||
|
pacman.conf.x86_64
|
||||||
|
makepkg.conf)
|
||||||
|
md5sums=('063c8b0ff6bdf903dc235445525627cd'
|
||||||
|
'SKIP'
|
||||||
|
'd0e015b1bf78cbf9762d9c44ea5f77a9'
|
||||||
|
'2db6c94709bb30cc614a176ecf8badb1'
|
||||||
|
'de74a13618347f08ae4a9637f74471c4'
|
||||||
|
'2da6544e387f940588a90cb4b9b914e2')
|
||||||
|
validpgpkeys=('6645B0A8C7005E78DB1D7864F99FFE0FEAE999BD') # Allan McRae <allan@archlinux.org>
|
||||||
|
|
||||||
|
prepare() {
|
||||||
|
cd "$pkgname-$pkgver"
|
||||||
|
patch -p1 -i $srcdir/0001-pacman-key-compatibility-with-gnupg-2.1.patch
|
||||||
|
}
|
||||||
|
|
||||||
|
build() {
|
||||||
|
cd "$pkgname-$pkgver"
|
||||||
|
|
||||||
|
./configure --prefix=/usr --sysconfdir=/etc \
|
||||||
|
--localstatedir=/var --enable-doc \
|
||||||
|
--with-scriptlet-shell=/usr/bin/bash \
|
||||||
|
--with-ldconfig=/usr/bin/ldconfig
|
||||||
|
make
|
||||||
|
make -C contrib
|
||||||
|
}
|
||||||
|
|
||||||
|
check() {
|
||||||
|
make -C "$pkgname-$pkgver" check
|
||||||
|
}
|
||||||
|
|
||||||
|
package() {
|
||||||
|
cd "$pkgname-$pkgver"
|
||||||
|
|
||||||
|
make DESTDIR="$pkgdir" install
|
||||||
|
make DESTDIR="$pkgdir" -C contrib install
|
||||||
|
|
||||||
|
# install Arch specific stuff
|
||||||
|
install -dm755 "$pkgdir/etc"
|
||||||
|
install -m644 "$srcdir/pacman.conf.$CARCH" "$pkgdir/etc/pacman.conf"
|
||||||
|
|
||||||
|
case $CARCH in
|
||||||
|
i686)
|
||||||
|
mycarch="i686"
|
||||||
|
mychost="i686-pc-linux-gnu"
|
||||||
|
myflags="-march=i686"
|
||||||
|
;;
|
||||||
|
x86_64)
|
||||||
|
mycarch="x86_64"
|
||||||
|
mychost="x86_64-unknown-linux-gnu"
|
||||||
|
myflags="-march=x86-64"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# set things correctly in the default conf file
|
||||||
|
install -m644 "$srcdir/makepkg.conf" "$pkgdir/etc"
|
||||||
|
sed -i "$pkgdir/etc/makepkg.conf" \
|
||||||
|
-e "s|@CARCH[@]|$mycarch|g" \
|
||||||
|
-e "s|@CHOST[@]|$mychost|g" \
|
||||||
|
-e "s|@CARCHFLAGS[@]|$myflags|g"
|
||||||
|
|
||||||
|
# put bash_completion in the right location
|
||||||
|
install -dm755 "$pkgdir/usr/share/bash-completion/completions"
|
||||||
|
mv "$pkgdir/etc/bash_completion.d/pacman" "$pkgdir/usr/share/bash-completion/completions"
|
||||||
|
rmdir "$pkgdir/etc/bash_completion.d"
|
||||||
|
|
||||||
|
for f in makepkg pacman-key; do
|
||||||
|
ln -s pacman "$pkgdir/usr/share/bash-completion/completions/$f"
|
||||||
|
done
|
||||||
|
|
||||||
|
install -Dm644 contrib/PKGBUILD.vim "$pkgdir/usr/share/vim/vimfiles/syntax/PKGBUILD.vim"
|
||||||
|
}
|
66
vendor/github.com/mikkeloscar/gopkgbuild/test_pkgbuilds/PKGBUILD_sudo
generated
vendored
Normal file
66
vendor/github.com/mikkeloscar/gopkgbuild/test_pkgbuilds/PKGBUILD_sudo
generated
vendored
Normal file
|
@ -0,0 +1,66 @@
|
||||||
|
# $Id: PKGBUILD 225542 2014-11-02 04:43:40Z foutrelis $
|
||||||
|
# Maintainer: Evangelos Foutras <evangelos@foutrelis.com>
|
||||||
|
# Contributor: Allan McRae <allan@archlinux.org>
|
||||||
|
# Contributor: Tom Newsom <Jeepster@gmx.co.uk>
|
||||||
|
|
||||||
|
pkgname=sudo
|
||||||
|
_sudover=1.8.11p2
|
||||||
|
pkgver=${_sudover/p/.p}
|
||||||
|
pkgrel=1
|
||||||
|
pkgdesc="Give certain users the ability to run some commands as root"
|
||||||
|
arch=('i686' 'x86_64')
|
||||||
|
url="http://www.sudo.ws/sudo/"
|
||||||
|
license=('custom')
|
||||||
|
groups=('base-devel')
|
||||||
|
depends=('glibc' 'pam' 'libldap')
|
||||||
|
backup=('etc/sudoers' 'etc/pam.d/sudo')
|
||||||
|
install=$pkgname.install
|
||||||
|
source=(http://www.sudo.ws/sudo/dist/$pkgname-$_sudover.tar.gz{,.sig}
|
||||||
|
sudo.tmpfiles.conf
|
||||||
|
sudo.pam)
|
||||||
|
sha256sums=('8133849418fa18cf6b6bb6893d1855ff7afe21db8923234a00bf045c90fba1ad'
|
||||||
|
'SKIP'
|
||||||
|
'080dd97111b3149f8d140ffac68c88acd63da9eacc81fbcc7c43591be13b42fe'
|
||||||
|
'd1738818070684a5d2c9b26224906aad69a4fea77aabd960fc2675aee2df1fa2')
|
||||||
|
|
||||||
|
build() {
|
||||||
|
cd "$srcdir/$pkgname-$_sudover"
|
||||||
|
|
||||||
|
./configure \
|
||||||
|
--prefix=/usr \
|
||||||
|
--sbindir=/usr/bin \
|
||||||
|
--libexecdir=/usr/lib \
|
||||||
|
--with-rundir=/run/sudo \
|
||||||
|
--with-vardir=/var/db/sudo \
|
||||||
|
--with-logfac=auth \
|
||||||
|
--with-pam \
|
||||||
|
--with-ldap \
|
||||||
|
--with-ldap-conf-file=/etc/openldap/ldap.conf \
|
||||||
|
--with-env-editor \
|
||||||
|
--with-passprompt="[sudo] password for %p: " \
|
||||||
|
--with-all-insults
|
||||||
|
make
|
||||||
|
}
|
||||||
|
|
||||||
|
check() {
|
||||||
|
cd "$srcdir/$pkgname-$_sudover"
|
||||||
|
make check
|
||||||
|
}
|
||||||
|
|
||||||
|
package() {
|
||||||
|
cd "$srcdir/$pkgname-$_sudover"
|
||||||
|
make DESTDIR="$pkgdir" install
|
||||||
|
|
||||||
|
# Remove /run/sudo directory from the package; we create it using tmpfiles.d
|
||||||
|
rmdir "$pkgdir/run/sudo"
|
||||||
|
rmdir "$pkgdir/run"
|
||||||
|
|
||||||
|
install -Dm644 "$srcdir/sudo.tmpfiles.conf" \
|
||||||
|
"$pkgdir/usr/lib/tmpfiles.d/sudo.conf"
|
||||||
|
|
||||||
|
install -Dm644 "$srcdir/sudo.pam" "$pkgdir/etc/pam.d/sudo"
|
||||||
|
|
||||||
|
install -Dm644 doc/LICENSE "$pkgdir/usr/share/licenses/sudo/LICENSE"
|
||||||
|
}
|
||||||
|
|
||||||
|
# vim:set ts=2 sw=2 et:
|
197
vendor/github.com/mikkeloscar/gopkgbuild/test_pkgbuilds/PKGBUILD_systemd
generated
vendored
Normal file
197
vendor/github.com/mikkeloscar/gopkgbuild/test_pkgbuilds/PKGBUILD_systemd
generated
vendored
Normal file
|
@ -0,0 +1,197 @@
|
||||||
|
# Maintainer: Dave Reisner <dreisner@archlinux.org>
|
||||||
|
# Maintainer: Tom Gundersen <teg@jklm.no>
|
||||||
|
|
||||||
|
pkgbase=systemd
|
||||||
|
pkgname=('systemd' 'libsystemd' 'systemd-sysvcompat')
|
||||||
|
pkgver=217
|
||||||
|
pkgrel=8
|
||||||
|
arch=('i686' 'x86_64')
|
||||||
|
url="http://www.freedesktop.org/wiki/Software/systemd"
|
||||||
|
makedepends=('acl' 'cryptsetup' 'docbook-xsl' 'gobject-introspection' 'gperf'
|
||||||
|
'gtk-doc' 'intltool' 'kmod' 'libcap' 'libidn' 'libgcrypt' 'libmicrohttpd'
|
||||||
|
'libxslt' 'util-linux' 'linux-api-headers' 'lz4' 'pam' 'python'
|
||||||
|
'python-lxml' 'quota-tools' 'shadow' 'xz')
|
||||||
|
options=('strip' 'debug')
|
||||||
|
source=("http://www.freedesktop.org/software/$pkgname/$pkgname-$pkgver.tar.xz"
|
||||||
|
'0001-nspawn-ignore-EEXIST-when-creating-mount-point.patch'
|
||||||
|
'0001-sd-dhcp-client-clean-up-raw-socket-sd_event_source-w.patch'
|
||||||
|
'0001-shared-install-avoid-prematurely-rejecting-missing-u.patch'
|
||||||
|
'0001-sd-bus-properly-handle-removals-of-non-existing-matc.patch'
|
||||||
|
'0001-units-don-t-order-journal-flushing-afte-remote-fs.ta.patch'
|
||||||
|
'0001-units-order-sd-journal-flush-after-sd-remount-fs.patch'
|
||||||
|
'0001-units-make-systemd-journald.service-Type-notify.patch'
|
||||||
|
'0001-shutdown-fix-arguments-to-run-initramfs-shutdown.patch'
|
||||||
|
'0001-udev-hwdb-Change-error-message-regarding-missing-hwd.patch'
|
||||||
|
'initcpio-hook-udev'
|
||||||
|
'initcpio-install-systemd'
|
||||||
|
'initcpio-install-udev')
|
||||||
|
md5sums=('e68dbff3cc19f66e341572d9fb2ffa89'
|
||||||
|
'ca9e33118fd8d456563854d95512a577'
|
||||||
|
'ade8c1b5b2c85d0a83b7bcf5aa6d131a'
|
||||||
|
'7aaf44ce842deb449fca0f2595bbc1e4'
|
||||||
|
'4adc3ddce027693bafa53089322e859b'
|
||||||
|
'42ff9d59bb057637355b202157d59991'
|
||||||
|
'92497d06e0af615be4b368fe615109c0'
|
||||||
|
'a321d62d6ffada9e6976bdd339fa3219'
|
||||||
|
'f72e8d086172177c224f0ce48ef54222'
|
||||||
|
'6326988822e9d18217525b2cb25cec1d'
|
||||||
|
'90ea67a7bb237502094914622a39e281'
|
||||||
|
'107c489f27c667be4101aecd3369b355'
|
||||||
|
'bde43090d4ac0ef048e3eaee8202a407')
|
||||||
|
|
||||||
|
|
||||||
|
prepare() {
|
||||||
|
cd "$pkgname-$pkgver"
|
||||||
|
|
||||||
|
patch -Np1 <../0001-nspawn-ignore-EEXIST-when-creating-mount-point.patch
|
||||||
|
patch -Np1 <../0001-sd-dhcp-client-clean-up-raw-socket-sd_event_source-w.patch
|
||||||
|
patch -Np1 <../0001-shared-install-avoid-prematurely-rejecting-missing-u.patch
|
||||||
|
patch -Np1 <../0001-sd-bus-properly-handle-removals-of-non-existing-matc.patch
|
||||||
|
patch -Np1 <../0001-units-don-t-order-journal-flushing-afte-remote-fs.ta.patch
|
||||||
|
patch -Np1 <../0001-units-order-sd-journal-flush-after-sd-remount-fs.patch
|
||||||
|
patch -Np1 <../0001-units-make-systemd-journald.service-Type-notify.patch
|
||||||
|
patch -Np1 <../0001-shutdown-fix-arguments-to-run-initramfs-shutdown.patch
|
||||||
|
patch -Np1 <../0001-udev-hwdb-Change-error-message-regarding-missing-hwd.patch
|
||||||
|
}
|
||||||
|
|
||||||
|
build() {
|
||||||
|
cd "$pkgname-$pkgver"
|
||||||
|
|
||||||
|
local timeservers=({0..3}.arch.pool.ntp.org)
|
||||||
|
|
||||||
|
./configure \
|
||||||
|
--libexecdir=/usr/lib \
|
||||||
|
--localstatedir=/var \
|
||||||
|
--sysconfdir=/etc \
|
||||||
|
--enable-introspection \
|
||||||
|
--enable-gtk-doc \
|
||||||
|
--enable-lz4 \
|
||||||
|
--enable-compat-libs \
|
||||||
|
--disable-audit \
|
||||||
|
--disable-ima \
|
||||||
|
--disable-kdbus \
|
||||||
|
--with-sysvinit-path= \
|
||||||
|
--with-sysvrcnd-path= \
|
||||||
|
--with-ntp-servers="${timeservers[*]}"
|
||||||
|
|
||||||
|
make
|
||||||
|
}
|
||||||
|
|
||||||
|
package_systemd() {
|
||||||
|
pkgdesc="system and service manager"
|
||||||
|
license=('GPL2' 'LGPL2.1' 'MIT')
|
||||||
|
depends=('acl' 'bash' 'dbus' 'glib2' 'kbd' 'kmod' 'hwids' 'libcap' 'libgcrypt'
|
||||||
|
'libsystemd' 'libidn' 'lz4' 'pam' 'libseccomp' 'util-linux' 'xz')
|
||||||
|
provides=('nss-myhostname' "systemd-tools=$pkgver" "udev=$pkgver")
|
||||||
|
replaces=('nss-myhostname' 'systemd-tools' 'udev')
|
||||||
|
conflicts=('nss-myhostname' 'systemd-tools' 'udev')
|
||||||
|
optdepends=('python: systemd library bindings'
|
||||||
|
'cryptsetup: required for encrypted block devices'
|
||||||
|
'libmicrohttpd: remote journald capabilities'
|
||||||
|
'quota-tools: kernel-level quota management'
|
||||||
|
'systemd-sysvcompat: symlink package to provide sysvinit binaries'
|
||||||
|
'polkit: allow administration as unprivileged user')
|
||||||
|
backup=(etc/dbus-1/system.d/org.freedesktop.systemd1.conf
|
||||||
|
etc/dbus-1/system.d/org.freedesktop.hostname1.conf
|
||||||
|
etc/dbus-1/system.d/org.freedesktop.login1.conf
|
||||||
|
etc/dbus-1/system.d/org.freedesktop.locale1.conf
|
||||||
|
etc/dbus-1/system.d/org.freedesktop.machine1.conf
|
||||||
|
etc/dbus-1/system.d/org.freedesktop.timedate1.conf
|
||||||
|
etc/pam.d/systemd-user
|
||||||
|
etc/systemd/bootchart.conf
|
||||||
|
etc/systemd/coredump.conf
|
||||||
|
etc/systemd/journald.conf
|
||||||
|
etc/systemd/logind.conf
|
||||||
|
etc/systemd/system.conf
|
||||||
|
etc/systemd/timesyncd.conf
|
||||||
|
etc/systemd/resolved.conf
|
||||||
|
etc/systemd/user.conf
|
||||||
|
etc/udev/udev.conf)
|
||||||
|
install="systemd.install"
|
||||||
|
|
||||||
|
make -C "$pkgname-$pkgver" DESTDIR="$pkgdir" install
|
||||||
|
|
||||||
|
# don't write units to /etc by default. some of these will be re-enabled on
|
||||||
|
# post_install.
|
||||||
|
rm "$pkgdir/etc/systemd/system/getty.target.wants/getty@tty1.service" \
|
||||||
|
"$pkgdir/etc/systemd/system/multi-user.target.wants/systemd-networkd.service" \
|
||||||
|
"$pkgdir/etc/systemd/system/multi-user.target.wants/systemd-resolved.service" \
|
||||||
|
"$pkgdir/etc/systemd/system/sysinit.target.wants/systemd-timesyncd.service" \
|
||||||
|
"$pkgdir/etc/systemd/system/network-online.target.wants/systemd-networkd-wait-online.service"
|
||||||
|
rmdir "$pkgdir/etc/systemd/system/getty.target.wants" \
|
||||||
|
"$pkgdir/etc/systemd/system/network-online.target.wants"
|
||||||
|
|
||||||
|
# get rid of RPM macros
|
||||||
|
rm -r "$pkgdir/usr/lib/rpm"
|
||||||
|
|
||||||
|
# add back tmpfiles.d/legacy.conf
|
||||||
|
install -m644 "systemd-$pkgver/tmpfiles.d/legacy.conf" "$pkgdir/usr/lib/tmpfiles.d"
|
||||||
|
|
||||||
|
# Replace dialout/tape/cdrom group in rules with uucp/storage/optical group
|
||||||
|
sed -i 's#GROUP="dialout"#GROUP="uucp"#g;
|
||||||
|
s#GROUP="tape"#GROUP="storage"#g;
|
||||||
|
s#GROUP="cdrom"#GROUP="optical"#g' "$pkgdir"/usr/lib/udev/rules.d/*.rules
|
||||||
|
sed -i 's/dialout/uucp/g;
|
||||||
|
s/tape/storage/g;
|
||||||
|
s/cdrom/optical/g' "$pkgdir"/usr/lib/sysusers.d/basic.conf
|
||||||
|
|
||||||
|
# add mkinitcpio hooks
|
||||||
|
install -Dm644 "$srcdir/initcpio-install-systemd" "$pkgdir/usr/lib/initcpio/install/systemd"
|
||||||
|
install -Dm644 "$srcdir/initcpio-install-udev" "$pkgdir/usr/lib/initcpio/install/udev"
|
||||||
|
install -Dm644 "$srcdir/initcpio-hook-udev" "$pkgdir/usr/lib/initcpio/hooks/udev"
|
||||||
|
|
||||||
|
# ensure proper permissions for /var/log/journal. This is only to placate
|
||||||
|
chown root:systemd-journal "$pkgdir/var/log/journal"
|
||||||
|
chmod 2755 "$pkgdir/var/log/journal"{,/remote}
|
||||||
|
|
||||||
|
# fix pam file
|
||||||
|
sed 's|system-auth|system-login|g' -i "$pkgdir/etc/pam.d/systemd-user"
|
||||||
|
|
||||||
|
# ship default policy to leave services disabled
|
||||||
|
echo 'disable *' >"$pkgdir"/usr/lib/systemd/system-preset/99-default.preset
|
||||||
|
|
||||||
|
### split out manpages for sysvcompat
|
||||||
|
rm -rf "$srcdir/_sysvcompat"
|
||||||
|
install -dm755 "$srcdir"/_sysvcompat/usr/share/man/man8/
|
||||||
|
mv "$pkgdir"/usr/share/man/man8/{telinit,halt,reboot,poweroff,runlevel,shutdown}.8 \
|
||||||
|
"$srcdir"/_sysvcompat/usr/share/man/man8
|
||||||
|
|
||||||
|
### split off runtime libraries
|
||||||
|
rm -rf "$srcdir/_libsystemd"
|
||||||
|
install -dm755 "$srcdir"/_libsystemd/usr/lib
|
||||||
|
cd "$srcdir"/_libsystemd
|
||||||
|
mv "$pkgdir"/usr/lib/lib{systemd,{g,}udev}*.so* usr/lib
|
||||||
|
|
||||||
|
# include MIT license, since it's technically custom
|
||||||
|
install -Dm644 "$srcdir/$pkgname-$pkgver/LICENSE.MIT" \
|
||||||
|
"$pkgdir/usr/share/licenses/systemd/LICENSE.MIT"
|
||||||
|
}
|
||||||
|
|
||||||
|
package_libsystemd() {
|
||||||
|
pkgdesc="systemd client libraries"
|
||||||
|
depends=('glib2' 'glibc' 'libgcrypt' 'lz4' 'xz')
|
||||||
|
license=('GPL2')
|
||||||
|
provides=('libgudev-1.0.so' 'libsystemd.so' 'libsystemd-daemon.so' 'libsystemd-id128.so'
|
||||||
|
'libsystemd-journal.so' 'libsystemd-login.so' 'libudev.so')
|
||||||
|
|
||||||
|
mv "$srcdir/_libsystemd"/* "$pkgdir"
|
||||||
|
}
|
||||||
|
|
||||||
|
package_systemd-sysvcompat() {
|
||||||
|
pkgdesc="sysvinit compat for systemd"
|
||||||
|
license=('GPL2')
|
||||||
|
groups=('base')
|
||||||
|
conflicts=('sysvinit')
|
||||||
|
depends=('systemd')
|
||||||
|
|
||||||
|
mv "$srcdir/_sysvcompat"/* "$pkgdir"
|
||||||
|
|
||||||
|
install -dm755 "$pkgdir/usr/bin"
|
||||||
|
for tool in runlevel reboot shutdown poweroff halt telinit; do
|
||||||
|
ln -s 'systemctl' "$pkgdir/usr/bin/$tool"
|
||||||
|
done
|
||||||
|
|
||||||
|
ln -s '../lib/systemd/systemd' "$pkgdir/usr/bin/init"
|
||||||
|
}
|
||||||
|
|
||||||
|
# vim: ft=sh syn=sh et
|
36
vendor/github.com/mikkeloscar/gopkgbuild/test_pkgbuilds/SRCINFO_glibc
generated
vendored
Normal file
36
vendor/github.com/mikkeloscar/gopkgbuild/test_pkgbuilds/SRCINFO_glibc
generated
vendored
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
# Generated by makepkg 4.2.0
|
||||||
|
# Mon Feb 2 23:44:57 UTC 2015
|
||||||
|
pkgbase = glibc
|
||||||
|
pkgdesc = GNU C Library
|
||||||
|
pkgver = 2.20
|
||||||
|
pkgrel = 6
|
||||||
|
url = http://www.gnu.org/software/libc
|
||||||
|
install = glibc.install
|
||||||
|
arch = i686
|
||||||
|
arch = x86_64
|
||||||
|
arch = armv6h
|
||||||
|
groups = base
|
||||||
|
license = GPL
|
||||||
|
license = LGPL
|
||||||
|
makedepends = gcc>=4.9
|
||||||
|
depends = linux-api-headers>=3.16
|
||||||
|
depends = tzdata
|
||||||
|
depends = filesystem>=2013.01
|
||||||
|
options = !strip
|
||||||
|
options = staticlibs
|
||||||
|
backup = etc/gai.conf
|
||||||
|
backup = etc/locale.gen
|
||||||
|
backup = etc/nscd.conf
|
||||||
|
source = http://ftp.gnu.org/gnu/libc/glibc-2.20.tar.xz
|
||||||
|
source = http://ftp.gnu.org/gnu/libc/glibc-2.20.tar.xz.sig
|
||||||
|
source = glibc-2.20-roundup.patch
|
||||||
|
source = locale.gen.txt
|
||||||
|
source = locale-gen
|
||||||
|
md5sums = 948a6e06419a01bd51e97206861595b0
|
||||||
|
md5sums = SKIP
|
||||||
|
md5sums = f7a5faf2911ae7c13f584bd60c802873
|
||||||
|
md5sums = 07ac979b6ab5eeb778d55f041529d623
|
||||||
|
md5sums = 476e9113489f93b348b21e144b6a8fcf
|
||||||
|
|
||||||
|
pkgname = glibc
|
||||||
|
|
75
vendor/github.com/mikkeloscar/gopkgbuild/test_pkgbuilds/SRCINFO_grub
generated
vendored
Normal file
75
vendor/github.com/mikkeloscar/gopkgbuild/test_pkgbuilds/SRCINFO_grub
generated
vendored
Normal file
|
@ -0,0 +1,75 @@
|
||||||
|
# Generated by makepkg 4.2.0
|
||||||
|
# Mon Feb 2 23:43:33 UTC 2015
|
||||||
|
pkgbase = grub
|
||||||
|
pkgdesc = GNU GRand Unified Bootloader (2)
|
||||||
|
pkgver = 2.02.beta2
|
||||||
|
pkgrel = 5
|
||||||
|
epoch = 1
|
||||||
|
url = https://www.gnu.org/software/grub/
|
||||||
|
install = grub.install
|
||||||
|
arch = x86_64
|
||||||
|
arch = i686
|
||||||
|
license = GPL3
|
||||||
|
makedepends = git
|
||||||
|
makedepends = rsync
|
||||||
|
makedepends = xz
|
||||||
|
makedepends = freetype2
|
||||||
|
makedepends = ttf-dejavu
|
||||||
|
makedepends = python
|
||||||
|
makedepends = autogen
|
||||||
|
makedepends = texinfo
|
||||||
|
makedepends = help2man
|
||||||
|
makedepends = gettext
|
||||||
|
makedepends = device-mapper
|
||||||
|
makedepends = fuse
|
||||||
|
depends = sh
|
||||||
|
depends = xz
|
||||||
|
depends = gettext
|
||||||
|
depends = device-mapper
|
||||||
|
optdepends = freetype2: For grub-mkfont usage
|
||||||
|
optdepends = fuse: For grub-mount usage
|
||||||
|
optdepends = dosfstools: For grub-mkrescue FAT FS and EFI support
|
||||||
|
optdepends = efibootmgr: For grub-install EFI support
|
||||||
|
optdepends = libisoburn: Provides xorriso for generating grub rescue iso using grub-mkrescue
|
||||||
|
optdepends = os-prober: To detect other OSes when generating grub.cfg in BIOS systems
|
||||||
|
optdepends = mtools: For grub-mkrescue FAT FS support
|
||||||
|
provides = grub-common
|
||||||
|
provides = grub-bios
|
||||||
|
provides = grub-emu
|
||||||
|
provides = grub-efi-x86_64
|
||||||
|
conflicts = grub-common
|
||||||
|
conflicts = grub-bios
|
||||||
|
conflicts = grub-emu
|
||||||
|
conflicts = grub-efi-x86_64
|
||||||
|
conflicts = grub-legacy
|
||||||
|
replaces = grub-common
|
||||||
|
replaces = grub-bios
|
||||||
|
replaces = grub-emu
|
||||||
|
replaces = grub-efi-x86_64
|
||||||
|
options = !makeflags
|
||||||
|
backup = boot/grub/grub.cfg
|
||||||
|
backup = etc/default/grub
|
||||||
|
backup = etc/grub.d/40_custom
|
||||||
|
source = grub-2.02::git+git://git.sv.gnu.org/grub.git#tag=grub-2.02-beta2
|
||||||
|
source = grub-extras::git+git://git.sv.gnu.org/grub-extras.git#branch=master
|
||||||
|
source = http://ftp.gnu.org/gnu/unifont/unifont-6.3.20131217/unifont-6.3.20131217.bdf.gz
|
||||||
|
source = http://ftp.gnu.org/gnu/unifont/unifont-6.3.20131217/unifont-6.3.20131217.bdf.gz.sig
|
||||||
|
source = grub-10_linux-detect-archlinux-initramfs.patch
|
||||||
|
source = grub-intel-ucode.patch
|
||||||
|
source = grub-add-GRUB_COLOR_variables.patch
|
||||||
|
source = 60_memtest86+
|
||||||
|
source = grub.default
|
||||||
|
source = grub.cfg
|
||||||
|
md5sums = SKIP
|
||||||
|
md5sums = SKIP
|
||||||
|
md5sums = 728b7439ac733a7c0d56049adec364c7
|
||||||
|
md5sums = SKIP
|
||||||
|
md5sums = 945527e0de8d384166a4cf23439ae9ee
|
||||||
|
md5sums = a678629bc82c4e70c48d28242036d1d7
|
||||||
|
md5sums = e506ae4a9f9f7d1b765febfa84e10d48
|
||||||
|
md5sums = be55eabc102f2c60b38ed35c203686d6
|
||||||
|
md5sums = a03ffd56324520393bf574cefccb893d
|
||||||
|
md5sums = c8b9511586d57d6f2524ae7898397a46
|
||||||
|
|
||||||
|
pkgname = grub
|
||||||
|
|
57
vendor/github.com/mikkeloscar/gopkgbuild/test_pkgbuilds/SRCINFO_linux
generated
vendored
Normal file
57
vendor/github.com/mikkeloscar/gopkgbuild/test_pkgbuilds/SRCINFO_linux
generated
vendored
Normal file
|
@ -0,0 +1,57 @@
|
||||||
|
# Generated by makepkg 4.2.0
|
||||||
|
# Mon Feb 2 23:47:51 UTC 2015
|
||||||
|
pkgbase = linux
|
||||||
|
pkgver = 3.18.5
|
||||||
|
pkgrel = 1
|
||||||
|
url = http://www.kernel.org/
|
||||||
|
arch = i686
|
||||||
|
arch = x86_64
|
||||||
|
license = GPL2
|
||||||
|
makedepends = xmlto
|
||||||
|
makedepends = docbook-xsl
|
||||||
|
makedepends = kmod
|
||||||
|
makedepends = inetutils
|
||||||
|
makedepends = bc
|
||||||
|
options = !strip
|
||||||
|
source = https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.18.tar.xz
|
||||||
|
source = https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.18.tar.sign
|
||||||
|
source = https://www.kernel.org/pub/linux/kernel/v3.x/patch-3.18.5.xz
|
||||||
|
source = https://www.kernel.org/pub/linux/kernel/v3.x/patch-3.18.5.sign
|
||||||
|
source = config
|
||||||
|
source = config.x86_64
|
||||||
|
source = linux.preset
|
||||||
|
source = change-default-console-loglevel.patch
|
||||||
|
sha256sums = becc413cc9e6d7f5cc52a3ce66d65c3725bc1d1cc1001f4ce6c32b69eb188cbd
|
||||||
|
sha256sums = SKIP
|
||||||
|
sha256sums = 9e261632e11f629705c3f1b2f07c611284e5f9972c42f6740131e8e2471c349a
|
||||||
|
sha256sums = SKIP
|
||||||
|
sha256sums = d3794c8b2cd11b71914b41f7a4e861369d4fa3c29fdd9e1d677ff0c2167eeb52
|
||||||
|
sha256sums = df7886f5d57f8f85e89987066dfa5c316e922dc0b22e6e6ad01331333db52377
|
||||||
|
sha256sums = f0d90e756f14533ee67afda280500511a62465b4f76adcc5effa95a40045179c
|
||||||
|
sha256sums = 1256b241cd477b265a3c2d64bdc19ffe3c9bbcee82ea3994c590c2c76e767d99
|
||||||
|
|
||||||
|
pkgname = linux
|
||||||
|
pkgdesc = The Linux kernel and modules
|
||||||
|
install = linux.install
|
||||||
|
depends = coreutils
|
||||||
|
depends = linux-firmware
|
||||||
|
depends = kmod
|
||||||
|
depends = mkinitcpio>=0.7
|
||||||
|
optdepends = crda: to set the correct wireless channels of your country
|
||||||
|
provides = kernel26=3.18.5
|
||||||
|
conflicts = kernel26
|
||||||
|
replaces = kernel26
|
||||||
|
backup = etc/mkinitcpio.d/linux.preset
|
||||||
|
|
||||||
|
pkgname = linux-headers
|
||||||
|
pkgdesc = Header files and scripts for building modules for Linux kernel
|
||||||
|
provides = kernel26-headers=3.18.5
|
||||||
|
conflicts = kernel26-headers
|
||||||
|
replaces = kernel26-headers
|
||||||
|
|
||||||
|
pkgname = linux-docs
|
||||||
|
pkgdesc = Kernel hackers manual - HTML documentation that comes with the Linux kernel
|
||||||
|
provides = kernel26-docs=3.18.5
|
||||||
|
conflicts = kernel26-docs
|
||||||
|
replaces = kernel26-docs
|
||||||
|
|
38
vendor/github.com/mikkeloscar/gopkgbuild/test_pkgbuilds/SRCINFO_openssh
generated
vendored
Normal file
38
vendor/github.com/mikkeloscar/gopkgbuild/test_pkgbuilds/SRCINFO_openssh
generated
vendored
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
# Generated by makepkg 4.2.0
|
||||||
|
# Mon Feb 2 23:36:37 UTC 2015
|
||||||
|
pkgbase = openssh
|
||||||
|
pkgdesc = Free version of the SSH connectivity tools
|
||||||
|
pkgver = 6.7p1
|
||||||
|
pkgrel = 1
|
||||||
|
url = http://www.openssh.org/portable.html
|
||||||
|
install = install
|
||||||
|
arch = i686
|
||||||
|
arch = x86_64
|
||||||
|
license = custom:BSD
|
||||||
|
makedepends = linux-headers
|
||||||
|
depends = krb5
|
||||||
|
depends = openssl
|
||||||
|
depends = libedit
|
||||||
|
depends = ldns
|
||||||
|
optdepends = xorg-xauth: X11 forwarding
|
||||||
|
optdepends = x11-ssh-askpass: input passphrase in X
|
||||||
|
backup = etc/ssh/ssh_config
|
||||||
|
backup = etc/ssh/sshd_config
|
||||||
|
backup = etc/pam.d/sshd
|
||||||
|
source = ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-6.7p1.tar.gz
|
||||||
|
source = ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-6.7p1.tar.gz.asc
|
||||||
|
source = sshdgenkeys.service
|
||||||
|
source = sshd@.service
|
||||||
|
source = sshd.service
|
||||||
|
source = sshd.socket
|
||||||
|
source = sshd.pam
|
||||||
|
sha1sums = 14e5fbed710ade334d65925e080d1aaeb9c85bf6
|
||||||
|
sha1sums = SKIP
|
||||||
|
sha1sums = cc1ceec606c98c7407e7ac21ade23aed81e31405
|
||||||
|
sha1sums = 6a0ff3305692cf83aca96e10f3bb51e1c26fccda
|
||||||
|
sha1sums = ec49c6beba923e201505f5669cea48cad29014db
|
||||||
|
sha1sums = e12fa910b26a5634e5a6ac39ce1399a132cf6796
|
||||||
|
sha1sums = d93dca5ebda4610ff7647187f8928a3de28703f3
|
||||||
|
|
||||||
|
pkgname = openssh
|
||||||
|
|
44
vendor/github.com/mikkeloscar/gopkgbuild/test_pkgbuilds/SRCINFO_pacman
generated
vendored
Normal file
44
vendor/github.com/mikkeloscar/gopkgbuild/test_pkgbuilds/SRCINFO_pacman
generated
vendored
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
# Generated by makepkg 4.2.0
|
||||||
|
# Mon Feb 2 23:35:22 UTC 2015
|
||||||
|
pkgbase = pacman
|
||||||
|
pkgdesc = A library-based package manager with dependency support
|
||||||
|
pkgver = 4.2.0
|
||||||
|
pkgrel = 6
|
||||||
|
url = http://www.archlinux.org/pacman/
|
||||||
|
arch = i686
|
||||||
|
arch = x86_64
|
||||||
|
groups = base
|
||||||
|
groups = base-devel
|
||||||
|
license = GPL
|
||||||
|
checkdepends = python2
|
||||||
|
checkdepends = fakechroot
|
||||||
|
makedepends = asciidoc
|
||||||
|
depends = bash
|
||||||
|
depends = glibc
|
||||||
|
depends = libarchive>=3.1.2
|
||||||
|
depends = curl>=7.39.0
|
||||||
|
depends = gpgme
|
||||||
|
depends = pacman-mirrorlist
|
||||||
|
depends = archlinux-keyring
|
||||||
|
provides = pacman-contrib
|
||||||
|
conflicts = pacman-contrib
|
||||||
|
replaces = pacman-contrib
|
||||||
|
options = strip
|
||||||
|
options = debug
|
||||||
|
backup = etc/pacman.conf
|
||||||
|
backup = etc/makepkg.conf
|
||||||
|
source = ftp://ftp.archlinux.org/other/pacman/pacman-4.2.0.tar.gz
|
||||||
|
source = ftp://ftp.archlinux.org/other/pacman/pacman-4.2.0.tar.gz.sig
|
||||||
|
source = pacman.conf.i686
|
||||||
|
source = pacman.conf.x86_64
|
||||||
|
source = makepkg.conf
|
||||||
|
source = pacman-4.2.0-roundup.patch
|
||||||
|
md5sums = 184ce14f1f326fede72012cca51bba51
|
||||||
|
md5sums = SKIP
|
||||||
|
md5sums = 2db6c94709bb30cc614a176ecf8badb1
|
||||||
|
md5sums = de74a13618347f08ae4a9637f74471c4
|
||||||
|
md5sums = 03d578816b56852d803cbafac85b9f09
|
||||||
|
md5sums = abe3baaf610d9cc42b4e3748c936bbce
|
||||||
|
|
||||||
|
pkgname = pacman
|
||||||
|
|
28
vendor/github.com/mikkeloscar/gopkgbuild/test_pkgbuilds/SRCINFO_sudo
generated
vendored
Normal file
28
vendor/github.com/mikkeloscar/gopkgbuild/test_pkgbuilds/SRCINFO_sudo
generated
vendored
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
# Generated by makepkg 4.2.0
|
||||||
|
# Mon Feb 2 23:32:24 UTC 2015
|
||||||
|
pkgbase = sudo
|
||||||
|
pkgdesc = Give certain users the ability to run some commands as root
|
||||||
|
pkgver = 1.8.11.p2
|
||||||
|
pkgrel = 1
|
||||||
|
url = http://www.sudo.ws/sudo/
|
||||||
|
install = sudo.install
|
||||||
|
arch = i686
|
||||||
|
arch = x86_64
|
||||||
|
groups = base-devel
|
||||||
|
license = custom
|
||||||
|
depends = glibc
|
||||||
|
depends = pam
|
||||||
|
depends = libldap
|
||||||
|
backup = etc/sudoers
|
||||||
|
backup = etc/pam.d/sudo
|
||||||
|
source = http://www.sudo.ws/sudo/dist/sudo-1.8.11p2.tar.gz
|
||||||
|
source = http://www.sudo.ws/sudo/dist/sudo-1.8.11p2.tar.gz.sig
|
||||||
|
source = sudo.tmpfiles.conf
|
||||||
|
source = sudo.pam
|
||||||
|
sha256sums = 8133849418fa18cf6b6bb6893d1855ff7afe21db8923234a00bf045c90fba1ad
|
||||||
|
sha256sums = SKIP
|
||||||
|
sha256sums = 080dd97111b3149f8d140ffac68c88acd63da9eacc81fbcc7c43591be13b42fe
|
||||||
|
sha256sums = d1738818070684a5d2c9b26224906aad69a4fea77aabd960fc2675aee2df1fa2
|
||||||
|
|
||||||
|
pkgname = sudo
|
||||||
|
|
118
vendor/github.com/mikkeloscar/gopkgbuild/test_pkgbuilds/SRCINFO_systemd
generated
vendored
Normal file
118
vendor/github.com/mikkeloscar/gopkgbuild/test_pkgbuilds/SRCINFO_systemd
generated
vendored
Normal file
|
@ -0,0 +1,118 @@
|
||||||
|
# Generated by makepkg 4.2.0
|
||||||
|
# Mon Feb 2 23:46:32 UTC 2015
|
||||||
|
pkgbase = systemd
|
||||||
|
pkgver = 218
|
||||||
|
pkgrel = 1
|
||||||
|
url = http://www.freedesktop.org/wiki/Software/systemd
|
||||||
|
arch = i686
|
||||||
|
arch = x86_64
|
||||||
|
makedepends = acl
|
||||||
|
makedepends = cryptsetup
|
||||||
|
makedepends = docbook-xsl
|
||||||
|
makedepends = gobject-introspection
|
||||||
|
makedepends = gperf
|
||||||
|
makedepends = gtk-doc
|
||||||
|
makedepends = intltool
|
||||||
|
makedepends = kmod
|
||||||
|
makedepends = libcap
|
||||||
|
makedepends = libidn
|
||||||
|
makedepends = libgcrypt
|
||||||
|
makedepends = libmicrohttpd
|
||||||
|
makedepends = libxslt
|
||||||
|
makedepends = util-linux
|
||||||
|
makedepends = linux-api-headers
|
||||||
|
makedepends = lz4
|
||||||
|
makedepends = pam
|
||||||
|
makedepends = python
|
||||||
|
makedepends = python-lxml
|
||||||
|
makedepends = quota-tools
|
||||||
|
makedepends = shadow
|
||||||
|
makedepends = xz
|
||||||
|
options = strip
|
||||||
|
options = debug
|
||||||
|
source = http://www.freedesktop.org/software/systemd/systemd-218.tar.xz
|
||||||
|
source = initcpio-hook-udev
|
||||||
|
source = initcpio-install-systemd
|
||||||
|
source = initcpio-install-udev
|
||||||
|
md5sums = 4e2c511b0a7932d7fc9d79822273aac6
|
||||||
|
md5sums = 90ea67a7bb237502094914622a39e281
|
||||||
|
md5sums = c9db3010602913559295de3481019681
|
||||||
|
md5sums = bde43090d4ac0ef048e3eaee8202a407
|
||||||
|
|
||||||
|
pkgname = systemd
|
||||||
|
pkgdesc = system and service manager
|
||||||
|
install = systemd.install
|
||||||
|
license = GPL2
|
||||||
|
license = LGPL2.1
|
||||||
|
license = MIT
|
||||||
|
depends = acl
|
||||||
|
depends = bash
|
||||||
|
depends = dbus
|
||||||
|
depends = glib2
|
||||||
|
depends = kbd
|
||||||
|
depends = kmod
|
||||||
|
depends = hwids
|
||||||
|
depends = libcap
|
||||||
|
depends = libgcrypt
|
||||||
|
depends = libsystemd
|
||||||
|
depends = libidn
|
||||||
|
depends = lz4
|
||||||
|
depends = pam
|
||||||
|
depends = libseccomp
|
||||||
|
depends = util-linux
|
||||||
|
depends = xz
|
||||||
|
optdepends = python: systemd library bindings
|
||||||
|
optdepends = cryptsetup: required for encrypted block devices
|
||||||
|
optdepends = libmicrohttpd: remote journald capabilities
|
||||||
|
optdepends = quota-tools: kernel-level quota management
|
||||||
|
optdepends = systemd-sysvcompat: symlink package to provide sysvinit binaries
|
||||||
|
optdepends = polkit: allow administration as unprivileged user
|
||||||
|
provides = nss-myhostname
|
||||||
|
provides = systemd-tools=218
|
||||||
|
provides = udev=218
|
||||||
|
conflicts = nss-myhostname
|
||||||
|
conflicts = systemd-tools
|
||||||
|
conflicts = udev
|
||||||
|
replaces = nss-myhostname
|
||||||
|
replaces = systemd-tools
|
||||||
|
replaces = udev
|
||||||
|
backup = etc/dbus-1/system.d/org.freedesktop.systemd1.conf
|
||||||
|
backup = etc/dbus-1/system.d/org.freedesktop.hostname1.conf
|
||||||
|
backup = etc/dbus-1/system.d/org.freedesktop.login1.conf
|
||||||
|
backup = etc/dbus-1/system.d/org.freedesktop.locale1.conf
|
||||||
|
backup = etc/dbus-1/system.d/org.freedesktop.machine1.conf
|
||||||
|
backup = etc/dbus-1/system.d/org.freedesktop.timedate1.conf
|
||||||
|
backup = etc/pam.d/systemd-user
|
||||||
|
backup = etc/systemd/bootchart.conf
|
||||||
|
backup = etc/systemd/coredump.conf
|
||||||
|
backup = etc/systemd/journald.conf
|
||||||
|
backup = etc/systemd/logind.conf
|
||||||
|
backup = etc/systemd/system.conf
|
||||||
|
backup = etc/systemd/timesyncd.conf
|
||||||
|
backup = etc/systemd/resolved.conf
|
||||||
|
backup = etc/systemd/user.conf
|
||||||
|
backup = etc/udev/udev.conf
|
||||||
|
|
||||||
|
pkgname = libsystemd
|
||||||
|
pkgdesc = systemd client libraries
|
||||||
|
license = GPL2
|
||||||
|
depends = glib2
|
||||||
|
depends = glibc
|
||||||
|
depends = libgcrypt
|
||||||
|
depends = lz4
|
||||||
|
depends = xz
|
||||||
|
provides = libgudev-1.0.so
|
||||||
|
provides = libsystemd.so
|
||||||
|
provides = libsystemd-daemon.so
|
||||||
|
provides = libsystemd-id128.so
|
||||||
|
provides = libsystemd-journal.so
|
||||||
|
provides = libsystemd-login.so
|
||||||
|
provides = libudev.so
|
||||||
|
|
||||||
|
pkgname = systemd-sysvcompat
|
||||||
|
pkgdesc = sysvinit compat for systemd
|
||||||
|
groups = base
|
||||||
|
license = GPL2
|
||||||
|
depends = systemd
|
||||||
|
conflicts = sysvinit
|
||||||
|
|
122
vendor/github.com/mikkeloscar/gopkgbuild/version_test.go
generated
vendored
Normal file
122
vendor/github.com/mikkeloscar/gopkgbuild/version_test.go
generated
vendored
Normal file
|
@ -0,0 +1,122 @@
|
||||||
|
package pkgbuild
|
||||||
|
|
||||||
|
import "testing"
|
||||||
|
|
||||||
|
// Test version comparison
|
||||||
|
func TestVersionComparison(t *testing.T) {
|
||||||
|
alphaNumeric := []Version{
|
||||||
|
"1.0.1",
|
||||||
|
"1.0.a",
|
||||||
|
"1.0",
|
||||||
|
"1.0rc",
|
||||||
|
"1.0pre",
|
||||||
|
"1.0p",
|
||||||
|
"1.0beta",
|
||||||
|
"1.0b",
|
||||||
|
"1.0a",
|
||||||
|
}
|
||||||
|
numeric := []Version{
|
||||||
|
"20141130",
|
||||||
|
"012",
|
||||||
|
"11",
|
||||||
|
"3.0.0",
|
||||||
|
"2.011",
|
||||||
|
"2.03",
|
||||||
|
"2.0",
|
||||||
|
"1.2",
|
||||||
|
"1.1.1",
|
||||||
|
"1.1",
|
||||||
|
"1.0.1",
|
||||||
|
"1.0.0.0.0.0",
|
||||||
|
"1.0",
|
||||||
|
"1",
|
||||||
|
}
|
||||||
|
git := []Version{
|
||||||
|
"r1000.b481c3c",
|
||||||
|
"r37.e481c3c",
|
||||||
|
"r36.f481c3c",
|
||||||
|
}
|
||||||
|
|
||||||
|
bigger := func(list []Version) {
|
||||||
|
for i, v := range list {
|
||||||
|
for _, v2 := range list[i:] {
|
||||||
|
if v != v2 && !v.bigger(v2) {
|
||||||
|
t.Errorf("%s should be bigger than %s", v, v2)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
smaller := func(list []Version) {
|
||||||
|
for i := len(list) - 1; i >= 0; i-- {
|
||||||
|
v := list[i]
|
||||||
|
for _, v2 := range list[:i] {
|
||||||
|
if v != v2 && v.bigger(v2) {
|
||||||
|
t.Errorf("%s should be smaller than %s", v, v2)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bigger(alphaNumeric)
|
||||||
|
smaller(alphaNumeric)
|
||||||
|
bigger(numeric)
|
||||||
|
smaller(numeric)
|
||||||
|
bigger(git)
|
||||||
|
smaller(git)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Test alphaCompare function
|
||||||
|
func TestAlphaCompare(t *testing.T) {
|
||||||
|
if alphaCompare("test", "test") != 0 {
|
||||||
|
t.Error("should be 0")
|
||||||
|
}
|
||||||
|
|
||||||
|
if alphaCompare("test", "test123") > 0 {
|
||||||
|
t.Error("should be less than 0")
|
||||||
|
}
|
||||||
|
|
||||||
|
if alphaCompare("test123", "test") < 0 {
|
||||||
|
t.Error("should be greater than 0")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Test CompleteVersion comparisons
|
||||||
|
func TestCompleteVersionComparison(t *testing.T) {
|
||||||
|
a := &CompleteVersion{
|
||||||
|
Version: "2",
|
||||||
|
Epoch: 1,
|
||||||
|
Pkgrel: 2,
|
||||||
|
}
|
||||||
|
|
||||||
|
older := []string{
|
||||||
|
"0-3-4",
|
||||||
|
"1-2-1",
|
||||||
|
"1-1-1",
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, o := range older {
|
||||||
|
if a.Older(o) {
|
||||||
|
t.Errorf("%s should be older than %s", o, a.String())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
newer := []string{
|
||||||
|
"2-1-1",
|
||||||
|
"1-3-1",
|
||||||
|
"1-2-3",
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, n := range newer {
|
||||||
|
if a.Newer(n) {
|
||||||
|
t.Errorf("%s should be newer than %s", n, a.String())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Benchmark rpmvercmp
|
||||||
|
func BenchmarkVersionCompare(b *testing.B) {
|
||||||
|
for i := 0; i < b.N; i++ {
|
||||||
|
rpmvercmp("1.0", "1.0.0")
|
||||||
|
}
|
||||||
|
}
|
25
vendor/vendor.json
vendored
25
vendor/vendor.json
vendored
|
@ -1,25 +0,0 @@
|
||||||
{
|
|
||||||
"comment": "",
|
|
||||||
"ignore": "test",
|
|
||||||
"package": [
|
|
||||||
{
|
|
||||||
"checksumSHA1": "sT9KemwEQt8FOjq/C5no9gpdFgU=",
|
|
||||||
"path": "github.com/jguer/go-alpm",
|
|
||||||
"revision": "f82ad11b38f675991ef2425dbeff03ef346bc113",
|
|
||||||
"revisionTime": "2017-05-07T12:31:44Z"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"checksumSHA1": "FNyfHWps1OdA3izWdVkxmPtMf1A=",
|
|
||||||
"path": "github.com/mikkeloscar/aur",
|
|
||||||
"revision": "dc2f99767ec5d809269bd3bac3878f6e949f8e64",
|
|
||||||
"revisionTime": "2017-05-02T13:48:13Z"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"checksumSHA1": "2MqUneYW520vQevWV6MITvYjdf4=",
|
|
||||||
"path": "github.com/mikkeloscar/gopkgbuild",
|
|
||||||
"revision": "46d010163d87513b0f05fb67400475348bd50cc9",
|
|
||||||
"revisionTime": "2017-05-09T09:30:41Z"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"rootPath": "github.com/jguer/yay"
|
|
||||||
}
|
|
Loading…
Reference in a new issue