Documentation
¶
Overview ¶
Copyright © 2022 Isteevan Shetoo <isteevan.shetoo@is-info.fr>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Copyright © 2022 Isteevan Shetoo <isteevan.shetoo@is-info.fr>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Copyright © 2022 Isteevan Shetoo <isteevan.shetoo@is-info.fr>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Copyright © 2022 Isteevan Shetoo <isteevan.shetoo@is-info.fr>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Index ¶
- Variables
- func CreateDirIfNotExist(dir string) error
- func DeleteEmptyFolder(folder string) error
- func GeFileBaseName(fileName string) string
- func GetCommand(command string) string
- func GetFileType(path string) string
- func GetHash(filepath string) (hash.Hash, error)
- func GetHashString(filepath string) (string, error)
- func GetStepsFromMacros(steps []string) ([]string, error)
- func IsExit(path string) bool
- func IsNotExist(path string) bool
- func IsPkgConfig(fpath string) bool
- func UpdateLineInFile(fpath, oldLine, newLine string) error
- func WritePackageXMLFile(rootPath, prefix string) error
- type File
- type PackageDesc
- func (s *PackageDesc) Archive(installDir, dest, prefix string) error
- func (s *PackageDesc) BuildStep(shell *Shell, dir string) error
- func (s *PackageDesc) GetFullName() string
- func (s *PackageDesc) InstallStep(shell *Shell, dir string) error
- func (s *PackageDesc) SetupStep(shell *Shell, dir string) error
- type Set
- type Shell
- type Source
Constants ¶
This section is empty.
Variables ¶
var FileTypes = map[string]string{
"PREFIX/lib/pkgconfig": "data",
"PREFIX/lib64/pkgconfig": "data",
"PREFIX/lib32/pkgconfig": "data",
"PREFIX/libexec": "executable",
"PREFIX/lib": "library",
"PREFIX/share/info": "info",
"PREFIX/share/man": "man",
"PREFIX/share/doc": "doc",
"PREFIX/share/help": "doc",
"PREFIX/share/gtk-doc": "doc",
"PREFIX/share/locale": "localedata",
"PREFIX/include": "header",
"PREFIX/bin": "executable",
"/bin": "executable",
"PREFIX/sbin": "executable",
"/sbin": "executable",
"/etc": "config",
}
FileTypes find the type of a file based on its path
var Macros = map[string]string{
"$configure": "./configure ${CONF_OPTS}",
"$make": "make -j${NBJOBS-1} ${MAKE_OPTS}",
"$make_install": "make install DESTDIR=${INSTALL_DIR-${prefix}} ${MAKE_INSTALL_OPTS}",
}
var PkgConfigDirs = []string{
"/lib/pkgconfig",
"/lib64/pkgconfig",
"/lib32/pkgconfig",
}
PkgConfigDirs the valid path of pkgconfig files
Functions ¶
func CreateDirIfNotExist ¶
func DeleteEmptyFolder ¶
func GeFileBaseName ¶
func GetCommand ¶
func GetFileType ¶
func GetHashString ¶
func GetStepsFromMacros ¶
func IsNotExist ¶
func IsPkgConfig ¶
IsPkgConfig check if the file is a package config
func UpdateLineInFile ¶
todo check file why is no readying
func WritePackageXMLFile ¶
Types ¶
type File ¶
type File struct { XMLName xml.Name `xml:"File"` Path string `xml:"Path"` Type string `xml:"Type"` UID int `xml:"Uid"` GID int `xml:"Gid"` Mode string `xml:"Mode"` Hash string `xml:"Hash"` }
File is the description of file within the archive. The archive represent compiled tarball
type PackageDesc ¶
type PackageDesc struct { Name string `yaml:"name"` Version string `yaml:"version"` Release string `yaml:"release"` Source Source `yaml:"source"` Licence string `yaml:"licence"` HomePage string `yaml:"homePage"` Summary string `yaml:"summary"` Description string `yaml:"description"` Setup []string `yaml:"setup"` Build []string `yaml:"build"` Install []string `yaml:"install"` }
func (*PackageDesc) Archive ¶
func (s *PackageDesc) Archive(installDir, dest, prefix string) error
func (*PackageDesc) GetFullName ¶
func (s *PackageDesc) GetFullName() string
func (*PackageDesc) InstallStep ¶
func (s *PackageDesc) InstallStep(shell *Shell, dir string) error
type Set ¶
Set is the list of file inside the compiled tarball (package)
func CreatePackageXMLFile ¶
func UnmarshalFilesXML ¶
func (*Set) VerifyIntegrity ¶
type Source ¶
type Source struct { URI string `yaml:"uri"` Sha256 string `yaml:"sha256"` Decompressed bool `yaml:"decompressed"` }
Source contains uri and sha256 of the tarball