10
25
2017

Planex 2.1.0 在 Fedora 26 上的安装

Planex 是维护本地 yum 源批量重构的工具,可用于维护第三方源或定制发行版。在某个基础包发生变化时,会按需自动重构所有依赖这个基础包的其它包。

  • 预先已经准备好 mock 的环境和用户(下面设为 cheese)

一、安装 planex

二、从头创建 planex 项目环境(构建两个 rpm)

  • 初始化目录结构
    • mkdir buildenv
    • cd buildenv
    • planex-init
      • 运行之后会创建一个 Makefile 文件
    • mkdir SPECS
    • ln -s _build/RPMS .
  • 根据当前默认 mock root 修改 Makefile
    • ls -l /etc/mock/default.cfg
lrwxrwxrwx. 1 root root 20 Oct 25 17:23 /etc/mock/default.cfg -> fedora-26-x86_64.cfg
  • 因此要修改 Makefile 变成 DIST?=.fc26
  • 将下面两个文件分别保存成对应的 spec 文件,放置于 SPECS 目录
Name:           perl-Furl
Version:        3.03
Release:        1%{?dist}
Summary:        Lightning-fast URL fetcher
License:        GPL+ or Artistic
Group:          Development/Libraries
URL:            http://search.cpan.org/dist/Furl/
Source0:        http://www.cpan.org/authors/id/T/TO/TOKUHIROM/Furl-%{version}.tar.gz
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch:      noarch
BuildRequires:  perl-generators
BuildRequires:  perl(Class::Accessor::Lite)
BuildRequires:  perl(Compress::Raw::Zlib)
BuildRequires:  perl(Encode)
BuildRequires:  perl(File::Temp)
BuildRequires:  perl(HTTP::CookieJar)
BuildRequires:  perl(HTTP::Parser::XS) >= 0.11
BuildRequires:  perl(IO::Socket::SSL)
BuildRequires:  perl(Module::Build)
BuildRequires:  perl(Mozilla::CA)
BuildRequires:  perl(Net::IDN::Encode)
BuildRequires:  perl(Scalar::Util)
BuildRequires:  perl(Socket)
BuildRequires:  perl(Test::More) >= 0.96
BuildRequires:  perl(Test::Requires)
BuildRequires:  perl(Test::TCP) >= 1.06
BuildRequires:  perl(Time::HiRes)
# Required for extra tests
BuildRequires:  perl(HTTP::Proxy)
BuildRequires:  perl(IO::Callback)
BuildRequires:  perl(Starlet)
BuildRequires:  perl(HTTP::Proxy::HeaderFilter::simple)
BuildRequires:  perl(Test::Fake::HTTPD)
Requires:       perl(Class::Accessor::Lite)
Requires:       perl(Compress::Raw::Zlib)
Requires:       perl(Encode)
Requires:       perl(HTTP::CookieJar)
Requires:       perl(HTTP::Parser::XS) >= 0.11
Requires:       perl(IO::Socket::SSL)
Requires:       perl(Mozilla::CA)
Requires:       perl(Net::IDN::Encode)
Requires:       perl(Scalar::Util)
Requires:       perl(Socket)
Requires:       perl(Time::HiRes)
Requires:       perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))

%description
Furl is yet another HTTP client library. LWP is the de facto standard HTTP
client for Perl 5, but it is too slow for some critical jobs, and too
complex for weekend hacking. Furl resolves these issues. Enjoy it!

%prep
%setup -q -n Furl-%{version}

%build
%{__perl} Build.PL installdirs=vendor
./Build

%install
rm -rf $RPM_BUILD_ROOT

./Build install destdir=$RPM_BUILD_ROOT create_packlist=0
find $RPM_BUILD_ROOT -depth -type d -exec rmdir {} 2>/dev/null \;

%{_fixperms} $RPM_BUILD_ROOT/*

%check

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root,-)
%doc Changes cpanfile LICENSE META.json README.md TODO
%{perl_vendorlib}/*
%{_mandir}/man3/*

%changelog
* Sat Sep 13 2014 Robin Lee <cheeselee@fedoraproject.org> 3.03-1
- Specfile autogenerated by cpanspec 1.78.
Name:           perl-IO-Callback
Version:        1.12
Release:        1%{?dist}
Summary:        IO::Callback Perl module
License:        GPL+ or Artistic
Group:          Development/Libraries
URL:            http://search.cpan.org/dist/IO-Callback/
Source0:        http://www.cpan.org/authors/id/T/TO/TOBYINK/IO-Callback-%{version}.tar.gz
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch:      noarch
BuildRequires:  perl-interpreter >= 0:5.006
BuildRequires:  perl-generators
BuildRequires:  perl(Carp)
BuildRequires:  perl(Fatal)
BuildRequires:  perl(File::Slurp)
BuildRequires:  perl(File::Temp)
BuildRequires:  perl(IO::String)
BuildRequires:  perl(Module::Build)
BuildRequires:  perl(Test::Exception)
BuildRequires:  perl(Test::More)
BuildRequires:  perl(Test::NoWarnings)
# required for extra tests
#BuildRequires:  perl(Pod::Snippets)
Requires:       perl(Carp)
Requires:       perl(IO::String)
Requires:       perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))

%description
"IO::Callback" provides an easy way to produce a phoney read-only
filehandle that calls back to your own code when it needs data to satisfy a
read. This is useful if you want to use a library module that expects to
read data from a filehandle, but you want the data to come from some other
source and you don't want to read it all into memory and use IO::String.

%prep
%setup -q -n IO-Callback-%{version}

%build
%{__perl} Build.PL installdirs=vendor
./Build

%install
rm -rf $RPM_BUILD_ROOT

./Build install destdir=$RPM_BUILD_ROOT create_packlist=0
find $RPM_BUILD_ROOT -depth -type d -exec rmdir {} 2>/dev/null \;

%{_fixperms} $RPM_BUILD_ROOT/*

%check

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root,-)
%doc Changes META.json README
%{perl_vendorlib}/*
%{_mandir}/man3/*

%changelog
* Sat Sep 13 2014 Robin Lee <cheeselee@fedoraproject.org> 1.12-1
- Specfile autogenerated by cpanspec 1.78.

 

  • 运行 make,最终 RPMS 目录就是一个 yum 源

三、其它现成 planex 项目环境(都在 XenServer 项目下)
https://github.com/xenserver/xen-api-libs-specs
https://github.com/xenserver/xen-api-base-specs
https://github.com/xenserver/unified-specs
https://github.com/xenserver/buildroot

Category: Fedora | Tags:
1
30
2010

Fedora下配置lighttpd+Django

这个blog的处女贴

1. 已有环境:

  • Fedora 12
  • Django project已配置好,位于 /var/www/django/mysite

2. 安装相关软件包:

sudo yum install python-flup lighttpd lighttpd-fastcgi 

3. 修改 /etc/lighttpd/lighttpd.conf 。中间省略了一大段,这只是最简单的配置

# lighttpd configuration file
#
# use it as a base for lighttpd 1.0.0 and above
#
# $Id: lighttpd.conf,v 1.7 2004/11/03 22:26:05 weigon Exp $

############ Options you really have to take care of ####################

## modules to load
# at least mod_access and mod_accesslog should be loaded
# all other module should only be loaded if really neccesary
# - saves some time
# - saves memory
## 去掉一些module的注释
server.modules              = (
                               "mod_rewrite",
                               "mod_redirect",
                               "mod_alias",
                                "mod_access",
#                               "mod_trigger_b4_dl",
#                               "mod_auth",
#                               "mod_status",
#                               "mod_setenv",
                               "mod_fastcgi",
#                               "mod_proxy",
#                               "mod_simple_vhost",
#                               "mod_evhost",
#                               "mod_userdir",
#                               "mod_cgi",
#                               "mod_compress",
#                               "mod_ssi",
#                               "mod_usertrack",
#                               "mod_expire",
#                               "mod_secdownload",
#                               "mod_rrdtool",
                                "mod_accesslog" )

## 省略了很多…………
## ………………………………

## include configuration snippets, usually provided by packages
include_shell "find /etc/lighttpd/conf.d -maxdepth 1 -name '*.conf' -exec cat {} \;"

## 加入以下内容
fastcgi.server = (
    "/mysite.fcgi" => (
        "main" => (
            # Use host / port instead of socket for TCP fastcgi
            #"host" => "127.0.0.1",
            #"port" => 8000,
            "socket" => "/tmp/mysite.sock",
            "check-local" => "disable",
        )
    ),
)

url.rewrite-once = (
    "^(/.*)$" => "/mysite.fcgi$1",
)

4. 创建快速运行脚本 /var/www/django/mysite/runfastcgi ,(其实放在哪里没所谓,)并添加执行权限

#!/bin/bash

# Replace these three settings.
PROJDIR="/var/www/django/mysite"
PIDFILE="$PROJDIR/django.pid"
SOCKET="/tmp/mysite.sock"

cd $PROJDIR
if [ -f $PIDFILE ]; then
kill `cat -- $PIDFILE`
rm -f -- $PIDFILE
fi

exec /usr/bin/env - \
PYTHONPATH="../python:.." \
./manage.py runfcgi socket=$SOCKET pidfile=$PIDFILE umask=000

5. 运行 lighttpd

sudo service lighttpd start

6. 访问 http://localhost/ ,大功告成

 

 

 参考: http://oteam.cn/2007/8/17/setting-lighttpd-django-on-ubuntu-server/

Category: Fedora | Tags: lighttpd fastcgi django

Host by is-Programmer.com | Power by Chito 1.3.3 beta | Theme: Aeros 2.0 by TheBuckmaker.com