# pdfpages rotate odd pages 180º

I'm trying to create a booklet with pdfpages. So far it's working, but I would like to tweak the page orientation to put all the spreads/pages "straight" (rotate odd pages 180º). I've tried different pdfpages options but nothing did the trick.

Right now I have this:

\documentclass[a4paper,landscape]{article}

\usepackage{pdfpages}

\begin{document}
\includepdf[nup=2x1,pages=-,booklet,noautoscale,frame]{phi.pdf}
\end{document}


This is what I want to achieve:

Here is a suggestion using a file step1.tex as intermediate file.

\documentclass[landscape]{article}
\usepackage{pgffor}
\usepackage{etoolbox}
\usepackage{pdfpages}

\usepackage{filecontents}
\begin{filecontents*}{\jobname-step1.tex}
\documentclass[a4paper,landscape]{article}
\usepackage{pdfpages}
\begin{document}
\includepdf[nup=2x1,pages=-,booklet,noautoscale,frame]{phi.pdf}
\end{document}
\end{filecontents*}

\immediate\write18{pdflatex \jobname-step1}% compiles \jobname-step1.tex

\begin{document}
\pdfximage{\jobname-step1.pdf}% counts pages in \jobname-step1.pdf
\foreach \p in {1,...,\the\pdflastximagepages}{%
\ifnumodd{\p}%
{\includepdf[pages=\p,angle=180]{\jobname-step1}}%
{\includepdf[pages=\p]{\jobname-step1}}%
}
\end{document}


Note that pdflatex --shell-escape is needed. Or you have to comment the line \immediate... and compile the file \jobname-step1 separatly.

Another solution is to make a local copy of pdfpages.sty and comment the following line:

\ifAM@sigrotate angle=180,\fi